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

Turning other adapters on/off


In this recipe, we will create a basic application that writes enable/disable actions to a tag and enables/disables the chosen adapter when the tag is detected.

Getting ready

In order to create a basic application that will turn the adapters on/off, make sure that you take care of the following elements:

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

  • Also, you should 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.

  • We assume that Eclipse is your development IDE and that you are familiar with writing external-type NdefRecords. Refer to the Working with external types recipe in Chapter 3, Writing Tag Content.

How to do it...

We will write an Integer value to a tag. This value represents an action to enable/disable Wi-Fi, network, GPS, and Bluetooth...