The code complements the recipe where we learn how to write a URI into a tag. Refer to the Working with custom mimes recipe in Chapter 3, Writing Tag Content. Perform the following steps:
Open Eclipse and create a new Android application project named
NfcBookCh5Example6with package name
Make sure the
AndroidManifest.xmlfile is correctly configured. Refer to the Requesting NFC permissions recipe in Chapter 1, Getting Started with NFC.
Set the minimum required version to API level 16.
MyClassfrom the Working with custom mimes recipe in Chapter 3, Writing Tag Content.
NfcHelperclass into the project and enable the foreground dispatch system.
Add the following class member and instantiate it in the
private NfcHelper nfcHelper; protected void onCreate(Bundle savedInstanceState...