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

Using Android Application Record


When we develop an app to write and read NFC tags, we most probably want this to happen when the user taps on a tag on their phone, and our app starts automatically even if it isn't running in the foreground. The Android system provides us with a pretty simple solution for this—AAR.

How to do it...

We are going to create an application that creates and writes an AAR to a tag by performing the following steps:

  1. Open Eclipse and create a new Android application project named NfcBookCh3Example4 with the package name nfcbook.ch3.example4.

  2. Make sure the AndroidManifest.xml file is configured correctly (refer to the Requesting NFC permissions recipe of Chapter 1, Getting Started with NFC).

  3. Set the minimum SDK version to 14:

    <uses-sdk android:minSdkVersion="14" /> 
  4. Make sure the foreground dispatch system is enabled (refer to the Understanding the foreground dispatch system recipe in Chapter 2, Detecting a Tag).

  5. Open MainActivity located under nfcbook.ch3.example4...