O'Reilly logo

Near Field Communication with Android Cookbook by Vitor Subtil

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling hotel room access with Arduino and NFC – Part 1

Imagine you are at a hotel where each lock to the rooms is controlled by Arduino with an NFC shield. When you arrive at your room and place the NFC card against the reader, Arduino will validate if it is indeed the correct card before releasing the lock.

In this recipe, we will create an Android application to write the room number on an NFC card encrypted with an AES algorithm.

How to do it...

We will encrypt the room door (padded left with 0 to have 16 as the length) with a 32-bit key and save the result to the tag:

  1. Open Eclipse and create a new Android application project named NfcBookCh9Example5 and package named nfcbook.ch9.example5.
  2. Make sure the AndroidManifest.xml file is correctly ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required