Beginning NFC: Near Field Communication with Arduino, Android, and PhoneGap

Beginning NFC: Near Field Communication with Arduino, Android, and PhoneGap

Tom Igoe, Don Coleman, Brian Jepson

Language: English

Pages: 246

ISBN: 1449372066

Format: PDF / Kindle (mobi) / ePub


Jump into the world of Near Field Communications (Nfc), the fast-growing technology that lets devices in close proximity exchange data, using radio signals. With lots of examples, sample code, exercises, and step-by-step projects, this hands-on guide shows you how to build Nfc applications for Android, the Arduino microcontroller, and embedded Linux devices.

You’ll learn how to write apps using the Nfc Data Exchange Format (Ndef) in PhoneGap, Arduino, and node.js that help devices read messages from passive Nfc tags and exchange data with other Nfc-enabled devices. If you know Html and JavaScript, you’re ready to start with Nfc.

  • Dig into Nfc’s architecture, and learn how it’s related to Rfid
  • Write sample apps for Android with PhoneGap and its Nfc plugin
  • Dive into Ndef: examine existing tag-writer apps and build your own
  • Listen for and filter Ndef messages, using PhoneGap event listeners
  • Build a full Android app to control lights and music in your home
  • Create a hotel registration app with Arduino, from check-in to door lock
  • Write peer-to-peer Nfc messages between two Android devices
  • Explore embedded Linux applications, using examples on Raspberry Pi and BeagleBone

 

 

 

 

 

 

 

 

 

 

 

 

Android Application Record. Start with a variable to write when a tag shows up: var app = { messageToWrite: [], // message to write on next NFC event Next comes an initialize() function to start things off and a bindEvents() function to set up an event listener to detect when the device is ready: // Application constructor initialize: function() { this.bindEvents(); console.log("Starting Foursquare Checkin app"); }, /* bind any events that are required on startup to listeners: */ bindEvents:

understanding both the embedded operating system approach and the singleprogram approach. Having shown you how to use NFC in an operating system context, we’ll show you the no-OS approach in this chapter. The Hardware Heart of NFC At the heart of NFC communication is a radio controller. When reading passive targets like the tags you’ve used so far, the controller is the initiator. It generates the radio signal that the tag receives, then waits for a returned signal, as explained in Chapter 2.

Technology professionals, software developers, web designers, and business and crea‐ tive professionals use Safari Books Online as their primary resource for research, prob‐ lem solving, learning, and certification training. 8 | Chapter 1: Introduction Safari Books Online offers a range of product mixes and pricing programs for organi‐ zations, government agencies, and individuals. Subscribers have access to thousands of books, training videos, and prepublication manuscripts in one fully

example. Within the 14443 family, there are several different formats including Philips and NXP Mifare tags, Sony FeliCa tags, and NXP DESFire. ISO-14443A tags are compatible with NFC, so you’ll see a lot of them in the pages that follow. How NFC Operates NFC can be thought of as an extension of RFID. NFC exchanges also involve an initiator and a target like RFID. However, it can do more than just exchange UIDs and read or write data to the target. The most interesting difference between RFID

Music User Interface Event Handlers NFC Event Handlers Enabling Background Dispatch Conclusion 97 98 101 104 104 105 106 109 110 112 114 118 121 126 128 129 7. Introduction to Arduino and NFC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 Digital Meets Physical: Arduino The Hardware Heart of NFC The Arduino Development Environment Serial Communication Installing Arduino Libraries The Arduino NDEF Library Reading NDEF in Arduino Writing NDEF in

Download sample

Download