Developing NFC Applications
This article explains how to create NFC applications for the latest NFC equiped Symbian phones using Qt or Java technology.
You can create applications that leverage NFC technology using APIs provided in Qt, Java™ ME, and Symbian C++. Of these options, using Qt is the recommended approach as it’s the core development framework for Symbian and is available for MeeGo powered devices as well.
Qt based development
You create NFC enabled applications using the Qt Mobility 1.2 Connectivity API. The advantage of this approach is that you are working with the productive Qt cross-platform API, so you can code once for an app that will run on Symbian and MeeGo devices.
- Qt Mobility 1.2 beta for Symbian add on for the Qt SDK 1.1: Installation instructions are provided in the package.
- Connectivity API documentation.
You can find example apps and code in the Qt Mobility 1.2 beta for Symbian add on package. The package enables development with the Symbian C++ NFC API also.
Further example apps are the NFC Corkboard (demonstrates NDEF reading and writing) and NFC Chat (LLCP peer-to-peer communication). In addition, you can download a step-by-step walkthrough tutorial that explains how to code these apps plus the basic Qt concepts required for understanding the interaction.
Java ME based development
You can make use of the NFC features in Symbian devices using the Contactless Communication API (JSR-257) and Nokia Extensions to JSR-257. This may be the most convenient approach if you have developed NFC applications for Series 40 devices (such as the Nokia 6131 NFC and Nokia 6212 classic). To get started you will need an NFC enabled device plus:
- NetBeans or Eclipse IDE
- Symbian^3 SDK 1.0
- NFC plug-in for the Nokia Symbian^3 SDK 1.0
- Developer's guide
You can use the NFC device SDKs for the Series 40 devices also, if you wish. In particular, these SDKs currently offer better features for testing.
Symbian C++ based development
If you’re familiar with Symbian C++ you can use the Symbian C++ APIs in a pure Symbian C++ app. To do this, you need an NFC enabled device plus:
- Symbian^3 SDK 1.0
- NFC plug-in for the Nokia Symbian^3 SDK
- API documentation
- Making Bluetooth connection by touching two NFC enabled (C7) phones
UI design considerations
As NFC is supported in a small (but set to grow) number of devices, it’s important to take this into account when creating your application. There are two approaches you can take:
- If your application offers functionality that relies entirely on NFC, you can restrict it to install on devices known to offer NFC hardware only.
- Where your application offers functionality that is useful without the use of NFC technology, then the UI should hide or disable the NFC features when running on a device without NFC hardware.
However, in both cases when running on the Nokia C7-00 your application should test to see if NFC functionality is available. If it’s not available the application should request the user to perform a firmware update (either using the SW Update application on their device or by running software update in Ovi Suite).
To determine if a device offers NFC:
- In a Qt or Symbian C++ application use the IsFeatureSupported method of the TFeatureSet class and test for KFeatureIdNfc (ID = 117).
- In a Java application query the javax.microedition.contactless.version system property value for the supported JSR-257 version. If the API is supported on the device, the property returns 1.0.
If you choose to develop with the NFC device SDKs for the Series 40 devices or make use of the Symbian^3 SDK with the NFC plug-in, these tools provide some emulation of NFC tags and devices suitable for application testing.
Features to emulate NFC tags and devices are planned for Qt SDK.
An NFC device is recommended also to complete testing prior to distributing your application.
Obtaining an NFC enabled device
As part of the Discounted Devices Program Nokia is making available an NFC Device Kit to Nokia Developer Launchpad and PRO members. The Kit includes an NFC mobile device and sample NFC tags. You can purchase it from here: Discounted Devices Program.
If you’re not a member of Launchpad or PRO, you can find details on how to join Launchpad here.