Leaving a (small) note – Part 2
In the Part 1 of this recipe, we were able to write a small note to a tag, but when we tapped the phone on the written tag, the application started but no content was displayed. In this recipe, we will complete the application by implementing the read tag content logic.
Getting ready
First, have a look at the Leaving a (small) note – Part 1 recipe in Chapter 4, Writing Tag Content – Real-life Examples, as we need to use the result code files in this recipe.
How to do it...
In Part 2 of the recipe, we will read the text in the tag and place it in EditText
. You can jump to step 5 if you have done Part 1 of the recipe and don't want to create a different project.
Open Eclipse and create a new Android application project named
NfcBookCh6Note
and package namednfcbook.ch6note
.Import the code and resources files from the Leaving a (small) note – Part 1 recipe in Chapter 4, Writing Tag Content – Real-life Examples.
Implement the
getNdefMessageFromIntent
and thegetFirstNdefRecord...