You are previewing Near Field Communication with Android Cookbook.
O'Reilly logo
Near Field Communication with Android Cookbook

Book Description

Discover the endless possibilities of using Android NFC capabilities to enhance your apps over 50 practical recipes

In Detail

Near Field Communication, or simply NFC, is an emerging technology with endless applicability. Its low battery consumption and simplicity are the keys to its success.

Near Field Communication with Android Cookbook is a hands-on book that will help you to set up your development environment, get to know the basics of NFC, and then use what you learn to create more enhanced and practical applications. This practical guide will teach you all you need know about NFC to get you started in developing outstanding out-of-the-box applications.

What You Will Learn

  • Work with the foreground dispatch system NFC data exchange format
  • Create several applications to consolidate knowledge and see what NFC can be used for
  • Read and write tags with URI, text, mime, and external types
  • Share content across two NFC-enabled devices
  • Extend NFC usage using Bluetooth and Wi-Fi
  • Combine NFC with social networks and games
  • Use Open NFC for Android to set up a virtual development and testing environment
  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. Near Field Communication with Android Cookbook
      1. Table of Contents
      2. Near Field Communication with Android Cookbook
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Getting Started with NFC
        1. Introduction
        2. Requesting NFC permissions
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Indicating that your app uses NFC
          1. How to do it…
          2. How it works…
        4. Defining minimal requirements
          1. How to do it…
          2. How it works…
        5. Verifying whether the device has an NFC adapter
          1. How to do it…
          2. How it works…
          3. There's more…
        6. Downloading Open NFC Android Edition
          1. Getting ready
          2. How to do it…
        7. Downloading Open NFC SDK Edition
          1. How to do it…
        8. Configuring the Open NFC Android add-on into your Android SDK
          1. Getting ready
          2. How to do it…
          3. How it works…
        9. Configuring an NFC-enabled testing AVD
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        10. Configuring the Connection Center tool
          1. Getting ready
          2. How to do it…
          3. How it works…
        11. Testing your app all together
          1. Getting ready
          2. How to do it…
          3. How it works…
      9. 2. Detecting a Tag
        1. Introduction
        2. Understanding the foreground dispatch system
          1. How to do it...
          2. How it works...
        3. Understanding the tag dispatch system
          1. How to do it...
          2. How it works...
        4. Verifying if your app started because of an NFC intent
          1. How to do it...
          2. How it works...
        5. Filtering tags by their content type
          1. How to do it...
          2. How it works...
        6. Filtering tags by their content type programmatically
          1. How to do it...
          2. How it works...
        7. Filtering tags by their technology
          1. How to do it...
          2. How it works...
        8. Filtering tags by their technology using programs
          1. How to do it...
          2. How it works...
        9. Filtering URI tags
          1. How to do it...
          2. How it works...
      10. 3. Writing Tag Content
        1. Introduction
        2. Working with the NDEF record
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Writing a URI-formatted record
          1. How to do it...
          2. How it works...
        4. Writing a text-formatted record
          1. How to do it...
          2. How it works...
        5. Using Android Application Record
          1. How to do it...
          2. How it works...
        6. Working with external types
          1. How to do it...
          2. How it works...
        7. Working with custom mimes
          1. How to do it...
          2. How it works...
      11. 4. Writing Tag Content – Real-life Examples
        1. Introduction
        2. Making a phone call with one tap – Part 1
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Sending a predefined SMS – Part 1
          1. How to do it…
          2. How it works…
        4. Visiting our website
          1. How to do it…
          2. How it works…
        5. Leaving a (small) note – Part 1
          1. How to do it…
          2. How it works…
      12. 5. Reading Tag Content
        1. Introduction
        2. Obtaining NDEF Message from Intent
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Getting the data out of the message
          1. How to do it…
          2. How it works…
        4. Reading a text-formatted record
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Reading a URI-formatted record
          1. How to do it…
          2. How it works…
        6. Reading external types
          1. How to do it…
          2. How it works…
        7. Reading custom mimes
          1. How to do it…
          2. How it works…
      13. 6. Reading Tag Content – Real-life Examples
        1. Introduction
        2. Making a phone call with one tap – Part 2
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Sending a predefined SMS – Part 2
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Leaving a (small) note – Part 2
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Getting the tag information
          1. How to do it...
          2. How it works...
      14. 7. Sharing Content across Devices
        1. Introduction
        2. Creating a basic peer-to-peer Hello World application
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Sending texts to other devices
          1. How to do it…
          2. How it works…
        4. Sending a friend invite on Facebook
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Inviting a friend to play a game – Part 1
          1. How to do it…
          2. How it works…
      15. 8. Error Handling and Content Validation
        1. Introduction
        2. Handling tag-writing errors
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Handling tag-reading errors
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Testing the tag data for integrity
          1. Getting ready
          2. How to do it...
          3. How it works...
      16. 9. Extending NFC
        1. Introduction
        2. Turning other adapters on/off
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Configuring a Wi-Fi network
          1. How to do it...
          2. How it works...
        4. Starting a Wi-Fi hotspot
          1. How to do it...
          2. How it works...
        5. Inviting a friend to play a game – Part 2
          1. How to do it...
          2. How it works...
        6. Controlling hotel room access with Arduino and NFC – Part 1
          1. How to do it...
          2. How it works...
        7. Controlling hotel room access with Arduino and NFC – Part 2
          1. Getting ready
          2. How to do it...
          3. How it works...
      17. 10. Real-life Examples – NFC Utilities
        1. Introduction
        2. Creating multi-action tags
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Choosing the best format for our data
          1. How to do it…
          2. How it works…
        4. Locking tags
          1. How to do it…
          2. How it works…
        5. Joking with a friend
          1. Getting ready
          2. How to do it…
          3. How it works…
      18. Index