URI is probably the most common content written to NFC tags. It allows you to share a website, an online service, or a link to the online content. This can be used, for example, in advertising and marketing.
Open Eclipse and create a new Android application project named
Make sure the
AndroidManifest.xmlfile is configured correctly (refer to the Requesting NFC permissions recipe from Chapter 1, Getting Started with NFC).
Set the minimum SDK version to
<uses-sdk android:minSdkVersion="14" />
writeNdefMessagemethods from the previous recipe—steps 2, 4, 6, and 7.
Add the following class member and instantiate it in the onCreate method:
private NfcAdapter nfcAdapter; protected...