Book Image

Near Field Communication with Android Cookbook

By : Subtil
Book Image

Near Field Communication with Android Cookbook

By: Subtil

Overview of this book

An easy-to-follow guide, full of hands-on examples of and real-world applications. Each recipe is explained and placed in context. If you want to learn how to create NFC-enabled Android applications, this is the book for you. Perhaps you already know a bit about Android application developments but have never used NFC, or perhaps you know a little about NFC android development but want some more advanced features and examples. In either case, this book will get you up and running quickly. You are expected to have Android programming knowledge.
Table of Contents (12 chapters)
11
Index

Obtaining NDEF Message from Intent


The Android system uses intents to carry data between activities, applications, and events. The same logic is applied in NFC. As we saw in Chapter 2, Detecting a Tag, the Tag instance can be obtained in the intent. The NDEF Messages can also be obtained from there and in this recipe we will see how they can be obtained.

Getting ready

The following settings are required for the recipe:

  • Make sure you have a working Android development environment. If you don't, ADT Bundle is a good start (http://developer.android.com/sdk/index.html).

  • Make sure you have an NFC-enabled Android device or a virtual test environment. Refer to the Testing your app all together recipe in Chapter 1, Getting Started with NFC.

  • It will be assumed that Eclipse is the development IDE.

How to do it…

On performing the following steps, a simple application that allows us to get an NDEF Message from a tag using the intent dispatch system will be created:

  1. Open Eclipse and create a new Android application...