28 March, 2014

How to write / read message to / from a NFC tag

The NFC Forum defines four tag types and gives them designations between 1 and 4. Each tag type has a different format and capacity.

Memory size limitation:
Type 1: up to 1KB
Type 2: up to 2KB
Type 3: up to 1MB
Type 4: up to 64K

Data Rate limitation:
The max communication speed is 424 Kbps, is lower than Bluetooth.

When your phone scans the tag, you have to make your phone unlock.

How to read / write:
Please refer to: http://developer.android.com/guide/topics/connectivity/nfc/advanced-nfc.html#read-write

To be simple:
READ:
Tech tech = Tech.get(Tag);
tech.connect();
tech.transceive(byte[]); 
tech.close();

WRITE:
Tech tech = Tech.get(Tag);
tech.connect();
byte[] data = tech.readValue(); 
tech.close();