Ever saw an NFC tag at a bus station and wanted to know what’s really stored on it? Just touch the tag with the Nfc Interactor app running on your phone, and you will instantly see low level information about the NFC tags and its contents.
If you’re lucky enough to have unlocked NFC tags, the dynamic NDEF message editor UI lets you create your own tags in the most flexible and comfortable way.
Nfc Interactor is now conveniently available in the Nokia Store for several NFC-enabled Symbian phones and the Nokia N9 with MeeGo Harmattan. The app is based on Qt and is completely open source as a code example, to inspire you and to enable re-use of its versatile and completely documented components for your own NFC apps.
NFC Tag Reading & Writing
Aimed at enthusiasts and developers, Nfc Interactor reveals low-level information about the NFC tags you touch, including their tag types, UIDs and for some tags additional information like the memory size and lock status.
Most NFC tags contain standardized NDEF messages (like Smart Posters, URIs or business cards), which are parsed and shown on-screen, nicely formatted so that you can easily read their contents.
The most powerful part of Nfc Interactor is the dynamic NDEF editor UI. Compose your own NDEF messages containing multiple NDEF records, just by adding all the records you need to a list. Many records support optional information, which you can supply if needed (e.g., the Smart Poster supports multiple titles in different languages and allows setting the recommended action for the reader). A short help text explains the basics of each record type. The top bar will always keep you updated on the size in bytes of your current creation, so that you can ensure it actually fits on your tag. Once finished, write your message to as many NFC tags as you like.
Advanced Nfc Tags
Nfc Interactor includes many ready-made templates for conveniently writing more advanced tag types. This includes Geo Tags to link to coordinates and launch the Maps application on the phone, or App Store tags to link to your app in the store corresponding to the actual mobile operating system of the user. More details about the web services working behind the scenes to enable those use-cases will be explained in upcoming blog posts.
On the social side, you can write business cards (in the common vCard format) and social network tags, which link to your favorite social service like Twitter, Facebook, LinkedIn or vKontakte. In the SMS record editor, you can directly enter the telephone number of the receiver and the body text to be sent — these records can for example also be used for payment via premium SMS (this method is used for many NFC tags that let you purchase a public transport ticket).
For low-level writing, you can also create custom records, which are needed for example to store app-specific information or to create autostart tags for apps (Nfc Interactor itself can be automatically launched through touching a tag that contains a record of the external RTD "nokia.com:nfcinteractor". Of course, a template for this is available in the editor UI as well.
Open Source Code Example
Nfc Interactor is completely open source and — like most Qt code examples — released under the open source BSD license. Many months of development went into creating the current version of the app, directly saving you development time.
While Qt Mobility already offers classes to conveniently handle Text and URI NDEF records, Nfc Interactor adds classes that manage Smart Posters, business cards, images, geo tags, app store tags, social network tags and SMS tags.
Additionally, you can see a real-life use of reading and writing NFC tags. For NFC Forum Tag Type 1 + 2 tags, the app uses tag-specific low-level commands to read their size and lock status (Symbian only). You will also see all components in place for automatically launching the app, for both MeeGo Harmattan and Symbian.
On the non-NFC side, the app also features a cross-platform UI for MeeGo Harmattan and Symbian using the respective Qt Quick Components — most parts of the QML code are similar, as a developer you only have to take account for a few UI differences!
Nfc Interactor is available for the Nokia N9 with MeeGo Harmattan (PR 1.1+ recommended), as well as the Nokia C7 / Astound / Oro with Symbian Anna, plus the Nokia 700 and Nokia 701. Support for the Nokia 603 and the C7 with Nokia Belle should be added by the Nokia Store soon.
The app can be downloaded for free. In addition to demonstrating the NFC APIs, it is also a real-life example and showcase for In-App-Advertising and In-App-Purchasing. The free version is always reads NFC tags, plus it writes an unlimited number of basic tags (e.g., URI, Text or Smart Poster) and up to 10 advanced tags. It is supported by the Qt ad-APIs provided by inneractive.
Upgrading to the Nfc Interactor Unlimited removes the ads and unlocks writing an unlimited number of advanced tags. On Symbian, you can conveniently purchase those upgrades through the Qt In-App-Purchasing APIs. For Harmattan, the Nfc Interactor Unlimited is an extra app available through the Nokia Store.
The complete source code of the application is available on the SVN server at Nokia Developer Projects.