Reading external types
In this recipe, we will see how we can identify external type formatted tags by testing the RDT value present in the first record with our external type formatted tags in the domain.name:typename
form.
How to do it…
This code complements the recipe where we learned how to write a URI into a tag. Refer to the Working with external types recipe in Chapter 3, Writing Tag Content.
Open Eclipse and create a new Android application project named
NfcBookCh5Example5
with package namecom.nfcbook.ch5.example65
.Make sure the
AndroidManifest.xml
file is correctly configured. Refer to the Requesting NFC permissions recipe in Chapter 1, Getting Started with NFC.Import the
NfcHelper
class into the project and enable the foreground dispatch system.Add the following class member and instantiate it in the onCreate method:
private NfcHelper nfcHelper; protected void onCreate(Bundle savedInstanceState) { nfcHelper = new NfcHelper(this); ... }
Override the
onNewIntent
method and place...