In the second screencast of this series, we’ll build upon the app we started in the first screencast and demonstrate how we can retrieve the payload of the tag within the Activity which was launched when the device detected a matching tag. Along the way we’ll explore some of the internals of how NFC tags are structured.
In the final screen cast of the series we’ll return to the Android chooser behavior which asks the user which application they wish to use to handle a newly discovered tag. We’ll then look at how we can add an Android Application Record to our NdefMessage which will effectively specify that our app will handle the tag and bypass the chooser. While it is very light on code, the concepts do require a little explanation to make the code changes understandable.
In the first screencast of this series we’ll cover the basics of NFC tags introducing NDEF and the Android tag dispatch system. We’ll look at how to add an intent-filter to the Manifest entry for a given Activity to enable that Activity to be launched when a matching tag is detected by the device.
In the third screencast of the Android NFC series, we’ll continue to build on the app we’ve been working on in the series so far. Now we’ll begin preparations to write to a tag by creating a new Activity which will use foreground dispatch to get notifications of any tags which are detected while it is in resumed state.
In this screen cast we’ll further build upon the app from the last cast where we got foreground dispatch working to handle tag discovery events within a resumed Activity. We’ll look at how we can construct an NdefRecord, and an NdefMessage and write this to a tag. We’ll also look at the difference in writing to an Ndef tag and an un-formatted NdefFormatable tag.