WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

16
Android and Near Field Communications Venkata Sastry Akella - Vivotech

description

Near Field Communications(NFC) is a fast growing technology which enables devices to connect and communicate when they are few centimeters apart. Currently NFC has been tested for several applications like mobile wallet, ticketing , secure entry, sharing the data between the devices etc. Banks, mobile operators, phone manufacturers and several other companies are working together to bring those applications and required ecosystem to everyone. Mobile wallet will be one of the important application and it allows users to download soft payment cards, loyalty cards, gift cards, coupons etc and use them with a tap. Latest version of Android mobile OS has support for NFC and several other companies expressed the availability of NFC capability in their upcoming version of software and devices.

Transcript of WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

Page 1: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

Android and Near Field Communications

Venkata Sastry Akella

- Vivotech

Page 2: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

NFC Introduction

• NFC is a very short range wireless communication technology works at 13.56Mhz frequency

• NFC range is about 4 cm

• Data speeds (106 kbits/s – 848 kbits/s)

• NFC standard is being developed by http://www.nfc-forum.org

Page 3: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

NFC Connection

NFC connectionWith a tap on smart tag

Page 4: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

NFC Communication Modes

• Active Communication: – Both initiator and target creates RF field. – Example: Both the devies are NFC enabled

phones

• Passive Communication:– Initiator creates the RF field that powers the

target– Example: Smart tags(RFID tags)

Page 5: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

NFC Operating Modes

• Card Emulation Mode– In this mode, NFC device emulates a contact

less card– Examples

• NFC phone in this mode can be used as contact less credit card

• NFC phone in this mode can be used as transit card (BART contactless card)

Page 6: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

NFC Peer to Peer Mode

• Peer to Peer mode enables devices to communicate with each other– Examples:

• In this mode NFC enabled phones can exchange contact information, pictures any other data

• NFC enabled phone and NFC enabled POS reader can exchange transaction data over Peer to Peer

Page 7: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

NFC Reader/Writer Mode

• Reader/Writer mode enables devices to interact with RF tags– Examples:

• NFC enabled phone can be used read smart poster

• NFC enabled phone can be used to program rfid tag

Page 8: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

NFC Support in Mobile Platforms

• Android: Android SDK 2.3.3 and above versions has support for NFC.– Samsung Nexus S

• Blackberry OS: Blackberry latest version has support for NFC.– Couple of bold models are announced with

NFC

• iOS and Windows expected to have NFC support by next year.

Page 9: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

ViVOtech Mobile Wallet/TSMViVOtech Mobile Wallet/TSM SolutionsSolutions

9

ContentProviders

Trusted Service Provider

Issuer ServerTrusted Service Provider (TSP)

Issuer Servers

Trusted Service Manager (TSM)

Control Server

Web Network

Signage

mTouch Trigger Manager

Web Network

Mobile Network

OTA OTA

NFC point of sale touchpoint reader Hardware &

Software

POS, Loyalty Systems

Financial POS Network

Web Network

Redemption Notifications

mTouch Content Manager

Page 10: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

NFC support in Android

• In the latest version of Android 2.3.4/2.3.5 has support for– Smart tag (RF tag) reading– Smart tag (RF tag) writing– P2P mode support– Contact less card emulation

Page 11: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

Android NFC APIs

• Android.nfc package:– NfcManager : High level manager to get

NfcAdapter instance– NfcAdapter: Represents the local NFC

adapter– NdefMessage: Represents nfc-forum defined

NDEF– NdefRecord: Represents nfc-forum defined

NDEF record.

Page 12: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

Android NFC APIs

• Android.nfc.tech : These classes provides access to tag technology features– NfcA, NfcB, NfcF, NfcV : Provides access to

NFC-A, NFC-B, NFC-F, NFC-V properties and i/o operations

– MifareClassic, MifareUltraLight: Provides access to NXP’s MIFARE classic and ultralight tag properties and i/o operations

Page 13: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

Android Tag Reading

• Register to receive intents with actions– NfcAdapter.ACTION_TAG_DISCOVERED– NfcAdapter.ACTION_TECH_DISCOVERED– NfcAdapter.ACTION_NDEF_DISCOVERED

• On tapping on the tag, app receives the intent with the tag data

– Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);

NdefMessage[] msgs;

msgs[i] = (NdefMessage) rawMsgs[i];

• Parse Records from NdefMessage. Example: The record could be a URI.

Page 14: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

Android Tag Writing

• Register to receive intent with the actions– NfcAdapter.ACTION_TECH_DISCOVERED

• Tap the NFC enabled phone tag to receive intent

– Tag mTag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);

NdefFormatable tag = NdefFormatable.get(t);

NdefRecord record = NdefRecord(NdefRecord.TNF_WELL_KNOWN, NdefRecord.RTD_TEXT, new byte[0], data);

NdefRecord[] records = {text};NdefMessage message = new NdefMessage(records);tag.connect();tag.format(message);

Page 15: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

Google Wallet

Soft payment cardsOffersOne tap payment

Page 16: WIP Back to School Webinars - Android and Near-Field Communications (NFC) presented by Vivotech

Further Reading

• NFC specifications available at– http://www.nfc-forum.org/home/

• Android SDK, Dev guides etc at– http://developer.android.com