Near Field Communication with Android Cookbook

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

Near Field Communication with Android Cookbook

Cookbook
Vitor Subtil

Discover the endless possibilities of using Android NFC capabilities to enhance your apps through over 60 practical recipes
$26.99
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

+ Collection
Free Sample

Book Details

ISBN 139781783289653
Paperback286 pages

About This Book

  • Practical and real-life examples showing how and where NFC can be used
  • Discover how to exploit NFC capabilities to enhance your apps to easily share and interact with the world
  • Learn how to extend cross-device content sharing by taking advantage of Android Beam's capabilities

Who This Book Is For

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

Chapter 1: Getting Started with NFC
Introduction
Requesting NFC permissions
Indicating that your app uses NFC
Defining minimal requirements
Verifying whether the device has an NFC adapter
Downloading Open NFC Android Edition
Downloading Open NFC SDK Edition
Configuring the Open NFC Android add-on into your Android SDK
Configuring an NFC-enabled testing AVD
Configuring the Connection Center tool
Testing your app all together
Chapter 2: Detecting a Tag
Introduction
Understanding the foreground dispatch system
Understanding the tag dispatch system
Verifying if your app started because of an NFC intent
Filtering tags by their content type
Filtering tags by their content type programmatically
Filtering tags by their technology
Filtering tags by their technology using programs
Filtering URI tags
Chapter 3: Writing Tag Content
Introduction
Working with the NDEF record
Writing a URI-formatted record
Writing a text-formatted record
Using Android Application Record
Working with external types
Working with custom mimes
Chapter 4: Writing Tag Content – Real-life Examples
Introduction
Making a phone call with one tap – Part 1
Sending a predefined SMS – Part 1
Visiting our website
Leaving a (small) note – Part 1
Chapter 5: Reading Tag Content
Introduction
Obtaining NDEF Message from Intent
Getting the data out of the message
Reading a text-formatted record
Reading a URI-formatted record
Reading external types
Reading custom mimes
Chapter 6: Reading Tag Content – Real-life Examples
Introduction
Making a phone call with one tap – Part 2
Sending a predefined SMS – Part 2
Leaving a (small) note – Part 2
Getting the tag information
Chapter 7: Sharing Content across Devices
Introduction
Creating a basic peer-to-peer Hello World application
Sending texts to other devices
Sending a friend invite on Facebook
Inviting a friend to play a game – Part 1
Chapter 8: Error Handling and Content Validation
Introduction
Handling tag-writing errors
Handling tag-reading errors
Testing the tag data for integrity
Chapter 9: Extending NFC
Introduction
Turning other adapters on/off
Configuring a Wi-Fi network
Starting a Wi-Fi hotspot
Inviting a friend to play a game – Part 2
Controlling hotel room access with Arduino and NFC – Part 1
Controlling hotel room access with Arduino and NFC – Part 2
Chapter 10: Real-life Examples – NFC Utilities
Introduction
Creating multi-action tags
Choosing the best format for our data
Locking tags
Joking with a friend

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

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.

Authors

Table of Contents

Chapter 1: Getting Started with NFC
Introduction
Requesting NFC permissions
Indicating that your app uses NFC
Defining minimal requirements
Verifying whether the device has an NFC adapter
Downloading Open NFC Android Edition
Downloading Open NFC SDK Edition
Configuring the Open NFC Android add-on into your Android SDK
Configuring an NFC-enabled testing AVD
Configuring the Connection Center tool
Testing your app all together
Chapter 2: Detecting a Tag
Introduction
Understanding the foreground dispatch system
Understanding the tag dispatch system
Verifying if your app started because of an NFC intent
Filtering tags by their content type
Filtering tags by their content type programmatically
Filtering tags by their technology
Filtering tags by their technology using programs
Filtering URI tags
Chapter 3: Writing Tag Content
Introduction
Working with the NDEF record
Writing a URI-formatted record
Writing a text-formatted record
Using Android Application Record
Working with external types
Working with custom mimes
Chapter 4: Writing Tag Content – Real-life Examples
Introduction
Making a phone call with one tap – Part 1
Sending a predefined SMS – Part 1
Visiting our website
Leaving a (small) note – Part 1
Chapter 5: Reading Tag Content
Introduction
Obtaining NDEF Message from Intent
Getting the data out of the message
Reading a text-formatted record
Reading a URI-formatted record
Reading external types
Reading custom mimes
Chapter 6: Reading Tag Content – Real-life Examples
Introduction
Making a phone call with one tap – Part 2
Sending a predefined SMS – Part 2
Leaving a (small) note – Part 2
Getting the tag information
Chapter 7: Sharing Content across Devices
Introduction
Creating a basic peer-to-peer Hello World application
Sending texts to other devices
Sending a friend invite on Facebook
Inviting a friend to play a game – Part 1
Chapter 8: Error Handling and Content Validation
Introduction
Handling tag-writing errors
Handling tag-reading errors
Testing the tag data for integrity
Chapter 9: Extending NFC
Introduction
Turning other adapters on/off
Configuring a Wi-Fi network
Starting a Wi-Fi hotspot
Inviting a friend to play a game – Part 2
Controlling hotel room access with Arduino and NFC – Part 1
Controlling hotel room access with Arduino and NFC – Part 2
Chapter 10: Real-life Examples – NFC Utilities
Introduction
Creating multi-action tags
Choosing the best format for our data
Locking tags
Joking with a friend

Book Details

ISBN 139781783289653
Paperback286 pages
Read More