In this recipe, we will see how to obtain several types of information regarding an NFC tag and its content.
We will get the tag information through the
Tag object instance, and the information regarding its content will be based on the first
NdefRecord present in the tag.
NfcBookCh7Example1and package named
AndroidManifest.xmlfile is configured correctly. Refer to the Requesting NFC permissions recipe in Chapter 1, Getting Started with NFC.
<intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED" /> <category android:name="android.intent.category.DEFAULT" ...