Вы находитесь на странице: 1из 13

NFC on Java ME

Valerie Tai
Nokia, SEAP

NFC on Java ME
JSR 257 Contactless Communiation API 1.0 supported on Symbian devices with NFC capabilities
Read/write small amounts of data to tags

Use cases
Detecting contactless targets Exchanging data with detected contactless targets
Note: Card Emulation and Peer to peer NOT supported
2

Java ME NFC Development


Both free IDEs come with extensive, generic Java ME support on board.

Extend with Symbian^3 SDK and the NFC plug-in *


* http://wiki.forum.nokia.com/index.php/About_NFC#Java_ME_based_development
3 2011 Nokia Nokia NFC Development v. 1.1.4 June 14, 2011 Andreas Jakl

Contactless Communication API


JSR 257
Tag discovery and data exchange

NDEF messages
First supported in Java Runtime 2.2 for Symbian (JRT 2.2)

Use cases
Download/store info from smart poster Exchange electronic business cards (with another NFC device)

Print an image store on the device using a smart printer


4

Detecting and Reading NDEF targets


For NDEF tag-reading, use the dedicated interface for NDEF Allows detection and reading of tags in one go without having to

separately specify target type and opening connection to the


target

Using Dedicated Interface


1. Import packages required

Using Dedicated Interface


2. Register an NDEFRecordListener for the desired NDEFRecordType by using the DiscoveryManager.addNDEFRecordListener method.

Using Dedicated Interface


3. To handle returned NDEF records, implement the NDEFRecordListener you registered in the previous step.

Example Project: NFCinteractor


The Java ME-based NFC Interactor can:
write many different NFC Forum NDEF message formats to all supported tag formats, delete the existing message from a tag (by overwriting it with an empty message), and read the contents of an NDEF-formatted tag. https://projects.forum.nokia.com/ nfcinteractor
9

Contactless Communication API Extensions


Extension
com.innovision.rf

Tag Type
NFC Forum Type 1 (NDEF)

Tags
Innovision Jewel, Innovision Topaz

com.nokia.nfc.nxp.mfstd

MIFARE Standard (NDEF)


(Note: proprietary type, not supported by NFC Forum)

MIFARE Classic 1K, MIFARE Classic 4K

com.nokia.nfc.nxp.simpletag

NFC Forum Type 2 (NDEF)

MIFARE Ultralight

com.sony.felica
10

NFC Forum Type 3 (NDEF)

Sony FeliCa

Permissions
API Call
DiscoveryManager.getInstance() ContactlessConnection.write (NDEFMessage message) opening NDEFTagConnection

Permission(s)
javax.microedition.contactless.DiscoveryManager javax.microedition.contactless.ndef.NDEFTagConnection.write

javax.microedition.io.Connector.ndef

11

Development Tools
Netbeans 7.0 / Eclipse Pulsar

Symbian^3 SDK
http://www.forum.nokia.com/info/sw.nokia.com/id/571baaf2-042a-4662-9d43a5a68eb42d9d/Symbian_3_SDK_v1_0_en.zip.html

NFC Plugin for the Symbian^3 SDK


http://www.forum.nokia.com/info/sw.nokia.com/id/fb8e0f5a-75db-4459-a82e6eee9e569a90/NFC_Plug_in_Symbian_3_SDK.html

14

Reference / Documentation
Introduction to NFC v1.1
http://www.developer.nokia.com/info/sw.nokia.com/id/bdaa4a0f-fcf3-4a4b-b800-

c664387d6894/Introduction_to_NFC.html

Java Developer Library


http://library.developer.nokia.com/ (online) http://www.developer.nokia.com/Resources/Documentation/ (download standalone version)

15

Вам также может понравиться