Thursday, October 20, 2011

Android app project_day3

Finally, ice cream sandwich reveals its face with a couple of awesome new features.
Google released the android 4.0 sdk as well.
It improves the NFC  API (if not a lot) quite a bit.
For instance:
1. when creating a mime type ndefRecord
previous version:
we have to write following code
NdefRecord tiredRecord = new NdefRecord(NdefRecord.TNF_MIME_MEDIA,"youMimeType".getBytes(Charset.forName("US-ASCII")),new byte[0], data.getBytes(Charset.forName("US-ASCII")));

new version:
NdefRecord happyRecord = createMimeRecord("yourMimeType",data.getBytes());

Much cleaner!

To be continued

No comments:

Post a Comment