Custom Search

Thursday, April 28, 2011

How To Have Fun with Near Field Communication on Android

At this juncture, we're all familiar with wireless communication technologies like Wi-Fi and Bluetooth. But one wireless tool that is just starting to roll out to the mainstream is near field communication, or NFC. The first Android phone with NFC was the Nexus S last December. If you pick up a Nexus S, Samsung Galaxy S II, or the Nexus S 4G on Sprint, you will have NFC capabilities in your phone.

But what is NFC, and what good is it? Stick around as we go over the technology, how it works on Android, and some fun do-it-yourself NFC projects.

What is NFC?

Near field communication is a specific set of wireless technologies that fall under the catch-all term RFID. NFC devices can only exchange information at a distance of less than 1.5 inches, or a little under 4cm (some specialized antennas can work up to 20cm away though). Data transfer speeds are a healthy 106 kbps to 848 kbps, depending on the device. For all intents and purposes, this is instantaneous tag reading and writing as NFC tags contain only a small amount of data.

You can use two phones, or other powered devices (sometimes called Active) to share NFC content provided both of them can read and write to NFC. What makes NFC truly interesting is that, like all RFID technologies, tags can be stored on un-powered chips. NFC works on the 13.56MHz frequency, and it is this radio frequency that makes passive tags possible.

When you hold an NFC capable device up to a passive, or un-powered tag, the RF field induces a current in the tag circuitry. That process generates power in the target, making it able to send and receive data. Pull the phone away, and the tag goes back to being an inert bit of copper.

What you can do with NFC

Passive NFC tag
Passive NFC tag
One of the most often cited uses of NFC technology is in mobile payment systems. In some countries this has already become the norm, but in the US we're just starting to get the industry up and running. A company called Isis has partnered with several large mobile phone carriers to begin a trial of their mobile phone payments in the coming years. There are also indications that Google is planning a test run of their own NFC payment system.

Right now you can easily use NFC technology to share data with your friends. On the Nexus S with the Android 2.3.3 update, you can create a tag on the phone with the built in Tags app. The tag can be, among other things, a contact card. If you toggle tag broadcasting on in the Tags app, any NFC device you hold up to the phone will read the contact and be able to save it. If you've ever used the popular Bump app, it has a similar feel, but no extra software is needed. You just place the phones near one another and it happens.

You can also create a URL tag in Android. This will present another Android user with a direct link to the site you've entered when they scan your tag. You can also enter raw text to be passed over the NFC link. The Android Tags app lets you create multiple tags and choose which one you want to transmit.

If you want to create your own passive NFC tags to leave around, or stick to the fridge, all you need is the right hardware. We purchased these NFC-compatible tags for testing. These tagsfrom the same retailer should also work. If those are out of stock, all you need to do is make sure you can get 13.56MHz RFID tags that are not write-protected from a different seller.

When you hold a blank NFC tag up to a compatible Android phone, you will have the option to write a tag to it. We suggest using NXP TagWriter to create custom tags. It has a friendly interface and lets you protect content if you don't want a tag re-written (for example if you're placing it in a public space). Like the stock Tags app, it lets you browse your tag history, but you can also easily reuse tags if you want to write a new tag with previous data. You can even append data to it.

With all this in mind, we embarked on a little DIY project to make use of NFC technology.

Making a smart dock for the Nexus S

One thing we always loved about the Nexus One was the spiffy desktop dock that triggered the Android clock app among other things. The Nexus S does not have that functionality, sadly. But with the Android 2.3.3 update, a blank NFC tag, and an app called NFC Task Launcher you can make a generic phone dock trigger apps and setting changes on the phone.

First, pick up NFC Task Launcher from the Market. It will cost you $1.99, but we've found it to work very well. When you open the app, choose Create Task. Hit the Add New Action button and pick from the list of functions. You can have the app toggle radios, launch apps, alter sounds, and even turn on the Wi-Fi hotspot. You have to hit the '+' button to actually add the task to the tag. There is also an option to add Tasker tasks to the tag, which expands the capacities of the app as far as your imagination can go.

Once you've built a task profile, tap the write tag button and place the device near your intended NFC tag. The tag will be written with the special Task Launcher tag and that's it. From now on, whenever you place your phone on or near that tag, it will perform the intended action with the assistance of NFC Task Launcher.

Dock with NFC tag attached
Dock with NFC tag attached
We obtained a simple dock for the Nexus S and created an NFC tag with NFC Task Launcher that enabled the ringer, set the volume, launched the Clock app, and enabled Wi-Fi. With a bit of double-sided tape, the NFC tag was affixed to the back of the dock. So whenever the phone is dropped into said dock, it wakes up and performs the tasks laid out. The result is an experience that is much more like the Nexus One dock than a regular plastic dock.

NFC Task Launcher also has a profile option where you can write a tag that initiates certain settings when you first scan a tag, then a different set the next time. It's great for putting your phone into 'work' mode, then using the same tag when you clock out to set it back to 'normal' mode.

No comments:

Post a Comment