NFC

When we announced the Xperia™ S and the Xperia™ SmartTags, as well as the Xperia™ ion, it marked an exciting new era, as these are the first Xperia™ devices supporting NFC. But what is really NFC? Surely you’ve heard about it, and know it’s expected to be widely used in the future. But how does it work, and how will it be used? In this article, you will get to know more about the technology, some of the use cases and how we will work with NFC initially.

NFC stands for Near Field Communication, and it’s a technology that enables data exchange between devices within a short distance, typically only a few centimetres. In most cases, the communication takes place between an active device and a non-powered target, but peer-to-peer interaction between two powered devices is also possible. Transfer rates are low, ranging from 106 Kbit/s to 424 Kbit/s, which means that use cases are all about small data exchanges. A typical use case would be to use the NFC connection as a trigger to set up Bluetooth™ or Wi-Fi™ connections.

With the new smartphones and devices supporting NFC, it will enhance the user experience of social applications and entertainment. You could tag your friends in a photo, or initiate multi-player games by tapping your handsets together. Check in at places, or even “like” things Facebook-style in real life by reading an NFC tag. Hold your phone close to a pair of speakers to start playing your music. These are some examples of existing and possible uses of the NFC technology. Since it is an open system, any app developer can come up with their own unique use cases.

Another use case is simplified secure transactions using apps like Google Wallet. With Google Wallet, you can have a virtual credit card and simply tap your phone at a reader in the store. You can also store virtual cards for things like customer loyalty information, access to buildings and transportation tickets.

NFC can be separated into three different technical modes which all suit different use cases: reader/writer mode, peer-to-peer mode and card emulation mode. When developing your own NFC-enabled app, you will find out that the different modes all cater to different needs, which are introduced below. In the Android SDK you find the information you need to get started with NFC in your own apps.

Interact with NFC tags using Reader/Writer mode
Reader/Writer mode is when the phone is the active part and reads data from or writes to an NFC tag. In Reader/Writer mode the phone is generating a field that is used to read information from passive tags that do not have any power source of their own. When you put a passive tag in the field close to a phone, the tag uses the field from the phone to send data back to the phone.

Many of the possible uses of NFC in reader/writer mode are about simplifying existing use cases. Instead of scanning a QR code – which requires installing a QR-reader app, opening the reader and scanning the QR code – you can simply touch an NFC tag with your phone with the screen lit up to get the same information. Bluetooth™ pairing is another use case that is made much easier: instead of searching for the gadget you want to connect to, you tap it with your phone and the pairing is done automatically.

Since NFC tags are available at relatively low cost, and can be produced in many different shapes, they can also be used to introduce physical real-world elements into games. For example, to go to the next level, you might have to find and read a tag at a certain place in your city.

Use P2P mode for smooth content sharing
With the smartphones like Xperia™ S and Xperia™ ion, you will be able to share content in a really easy way. When touching another NFC device with your phone, the application in use will automatically send the active content, for example, the track that is currently playing in the Media player, or the contact displayed on the screen if you are browsing through your contacts.

In Xperia™ S and Xperia™ ion, this function is enabled in the pre-installed Gallery, Music player, Web browser and Contacts. In our sharing function NFC is normally used to initiate the connection and then handover is done to a faster bearer such as Bluetooth™ or Wi-Fi®, which makes it work well for locally stored content.

To share content between two devices, peer-to-peer mode is used. This is suitable whenever multi-pass communication is needed, which means the two devices have to talk to each other and confirm the interaction. This mode is defined by the NFC Forum, who defines the NFC standard, and differentiates NFC from earlier proprietary RFID variants, which only works between an active device and a passive tag.

Android Beam is the standard Android implementation of P2P mode which is introduced in the Ice Cream Sandwich release. It works for sharing small pieces of content, for example links to web content. Using Android Beam, you can add the possibility for users to share content from your own app. However, there is no support in Android Beam for the handover to Bluetooth™ or Wi-Fi®.

Card emulation mode – it’s all about secure transactions
The card emulation mode is used for secure transactions, such as payments, transportation tickets, or when using the phone to access buildings. The card emulation mode can always be active in the phone, since the phone functions as a tag and there is no need to generate a field from the phone. The phone only needs to be ready to respond when being close to an NFC reader. If allowed by the service provider, card emulation can even work when the phone is switched off. Writing applications for card emulation mode requires the opportunity to access the secure element, which most developers don’t have.

Xperia™ SmartTags.

Using Xperia™ SmartTags
An Xperia™ SmartTag is a read-only tag, containing an ID. In the LiveWare™ manager application you can configure what action that should be performed when a certain Xperia™ SmartTag is read. This means that reading the tag will have a result that is specific for your phone, while reading the same tag with a differently configured phone will give another result. For example, you can set up a special “work tag” at your desk, which will trigger the ringtone volume to be lowered and music to be turned off.

More information