-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Near Field Communication with Android Cookbook
By :
While developing other recipes, we have seen different ways of storing our data in an NFC tag. From a simple plain text to a raw object, it all depends on the data we need to store. In this recipe, we will learn about some other formats to store our data.
We will create several NdefMessages that contain a product representation in several formats by performing the following steps:
Open Eclipse and create a new Android application project named NfcBookCh10Example2 and a package named nfcbook.ch10.example2.
Download the google-gson library from https://code.google.com/p/google-gson/ and import the .jar file to the libs folder in the project.
Set the minimum SDK version to 16 using the following code:
<uses-sdk android:minSdkVersion="16" />
Add the strings given in the following code to the strings.xml file available at res/values/:
<string name="label_raw">Raw</string> <string name="label_json">JSON</string> <string...
Change the font size
Change margin width
Change background colour