Book Image

Near Field Communication with Android Cookbook

By : Vitor Subtil
Book Image

Near Field Communication with Android Cookbook

By: Vitor Subtil

Overview of this book

Table of Contents (17 chapters)
Near Field Communication with Android Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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.

  1. Open Eclipse and create a new Android application project named NfcBookCh6Note and package named nfcbook.ch6note.

  2. Import the code and resources files from the Leaving a (small) note – Part 1 recipe in Chapter 4, Writing Tag Content – Real-life Examples.

  3. Implement the getNdefMessageFromIntent and the getFirstNdefRecord...