Start NFC Development with the Qt SDK today!

ajakl | 29 September, 2011 11:43

Qt NFCWith the current Qt SDK (1.2.0 or newer) the scope of Nokia's NFC developer offering took a significant step forward. It features the final environment for developing NFC apps on Symbian and Harmattan using Qt.

In order to enable you to take full advantage of the Qt / NFC development options, read this small guide that will make your first steps easier. For more information, please also check out the NFC technology pages at Nokia Developer!

Windows, Linux, Mac

You can develop NFC apps for the Nokia N9 with MeeGo Harmattan on all platforms supported by the Qt SDK: Windows, Linux and Mac OS X.

Tools Installation

When you download and install the Qt SDK, ensure the following are selected:

  • Development Tools -> Symbian Toolchains -> Symbian Anna
  • Development Tools -> Harmattan

In case you forgot to enable for example the Harmattan package during installation, start the "SDK Maintenance Tool" to download and add these components to your existing Qt SDK installation.

Device Setup

Follow the instructions for all devices you want to enable for working with NFC:

  • Nokia N9 / MeeGo Harmattan: The device already ships with Qt Mobility 1.2; no installation is needed. The Nokia N950 is running the same MeeGo Harmattan platform, but lacks NFC hardware.
  • Nokia C7-00 with Symbian^3: NFC hardware comes with every C7 in the market, but you need Symbian Anna to enable NFC functionality. Therefore, make sure you run the "SW update" on the device, or use the Nokia (Ovi) Suite to start the firmware and the following application update! Your device should have software version Symbian Anna / 022.014 or newer (enter *#0000# in the dialer to check).
  • Nokia C7-00 with Symbian Anna: the device is ready for NFC development using Java ME or Symbian native C++. In order to use Qt for NFC development, you need to update the device environment to the latest version, in case the new Qt versions are not already on your phone:
    • Install Qt 4.7.4: C:\QtSDK\Symbian\sis\Symbian_Anna\Qt\4.7.4\Qt-4.7.403-for-Anna.sis
    • Qt WebKit: C:\QtSDK\Symbian\sis\Symbian_Anna\Qt\4.7.4\QtWebKit-4.8.1-for-Anna.sis
    • Qt Mobility 1.2.1: C:\QtSDK\Symbian\sis\Symbian_Anna\QtMobility\1.2.1\QtMobility-1.2.1-for-Anna.sis
    • (Recommended) Qt Quick Components: C:\QtSDK\Symbian\sis\Symbian_Anna\QtQuickComponents\1.1\QtQuickComponents-1.1-for-Anna-Belle.sis
  • Nokia 603 / 700 / 701 / C7-00 / 808 PureView with Nokia Belle or newer: if you're lucky enough to have a NFC capable device with Nokia Belle +, you don't need to do anything to enable Qt NFC development. Qt 4.7.4+ and Qt Mobility 1.2+ are already pre-installed and work out of the box. Do not overwrite the existing Qt / Qt Mobility installation with files from the Qt SDK that are intended for the Symbian Anna version only!

In addition, make sure you make your phone ready for communication with the Qt Creator IDE and on-device-debugging. This involves installing the "CODA" debug agent on all Symbian devices (no matter which version), or the "SDK Connectivity" tool on the Nokia N9. See the help of Qt Creator for more details.

Development

In general, it is highly recommended to use Qt Quick Components for developing the UI of your NFC application. Qt Quick Components are supported on all NFC capable Symbian and MeeGo phones. More information, for example on NFC availability detection, is available on the NFC technology pages.

Nokia N9 / MeeGo Harmattan: simply select the MeeGo Harmattan target to build and deploy your application to the Nokia N9.

Symbian: select the "Qt 4.7.4 for Symbian Anna" target of Qt Creator to develop your application to any Symbian^3 / Anna / Belle phone.
Note: Qt SDK offers a Symbian Belle specific SDK. The apps developed with the Anna target are also compatible to Belle; you only need the Belle SDK in case you access native Symbian libraries (=> non-Qt) unique to Nokia Belle.

Examples to get started

The best way to get started is reading through the Nokia NFC Development with Qt Mobility presentation. It explains the basics of NFC specifications, how the Qt Mobility APIs provide easy access to the technology and then walks you through two hands-on examples.

The three recommended sample-projects to check — all of them are working on Symbian and on MeeGo Harmattan:

  • Nfc Info: Shows all information about NFC tags available through Qt Mobility APIs. Includes reusable convenience classes for handling additional record types: Smart Poster, Image and vCard.
  • Nfc Corkboard: Extends the Qt Quick Corkboards example of the Qt SDK with NFC functionality: touch a tag and its NDEF contents appear as a new note on the screen. Press the NFC flag of a note on the screen and its contents will be written to the tag. Parses URI, text, Smart Poster and vCard records and shows a generic post-it for all other tag types. Includes NDEF autostart support for MeeGo Harmattan PR 1.1+.
  • Nfc Chat: The Nfc Chat is a sample app that demonstrates how to use the NFC LLCP protocol to create a peer-to-peer connection between two compatible NFC Forum devices and how to send messages between those devices.

More information can be found on the NFC technology pages.

Nokia Store Deployment

Deploying NFC apps to the Nokia store is fully supported on the Nokia Store. For more details on the deployment of NFC applications, make sure to check our NFC developer pages!

Known Limitations

To save you some time, the known limitations at this time:

  • No raw, tag-specific access on Symbian Anna: this doesn't mean that the phone cannot interact with specific tags; reading and writing NDEF messages always works fine. Each tag type platform (e.g., NFC Forum Type 1 Tag Platform) has its own low-level protocol, where you can send commands as byte-arrays, and then parse the byte-array returned from the tag. This raw access does work fine on Symbian Belle, but is unsupported using the current Qt Moblity 1.2.1 version on Symbian Anna.
  • No raw, tag-specific access on MeeGo Harmattan: as described in the Qt Mobility documentation, tag-type specific access as described above is not supported on MeeGo Harmattan.
  • Qt Simulator: the simulator has a very powerful editor to create your own NDEF messages and records. You can use it to test your Qt application.
    Note that the two-step method of reading messages consisting of listening for targets and then asking the target for its contents does not work as expected. If you use the direct one-step process through QNearFieldManager::registerNdefMessageHandler(), the simulator works fine.
  • NFC QML Bindings: even though Qt Mobility 1.2 includes QML bindings to make the Qt/C++ NFC-APIs available in the QML environment, it's recommended to use only the Qt/C++ APIs. The documentation and features supported by the QML bindings are very limited. It's easy to combine a C++ NFC-handler class with your QML user interface code — all three Qt NFC examples linked above (Nfc Info, etc.) demonstrate how to do this. You can then take the NFC-handling C++ class and simply plug it into any QML project you wish.

Update (22. November 2011): Adapted the article with the latest status following the release of the Qt SDK 1.1.4.
Update (6. March 2012): Added Nokia 808 PureView to compatibility, updated references to Qt SDK 1.2.

NFC Device Kit available

jures33 | 29 September, 2011 10:18

While development and testing of applications can be done using simulators and emulators, nothing beats running and debugging your application on a real device. For this purpose we are making a special Nokia NFC Device Kit available for developers

For applications utilising NFC the need for a physical device is even more important. To be able to test how 2 devices react to each other with your application running, how well they react to different tags and different content stored on those tags, having access to a physical device is paramount.

For that reason we have made avaialable a dedicated NFC device KIT for developers. The kit includes:

  • 1 X Nokia C7 (with Sybmian Anna software supporting NFC)
  • 12 X Type 1 NFC tags (Topaz 96 bytes) 
  • 12 X Type 2 NFC tags (Ultralight C 64 bytes)
  • 1 X Special offer voucher for NFC products in TopTunniste webshop

The price of the NFC device Kit is 180 Euros. Note: the device indended use is for development and testing and thus special sales terms apply.

The Device Kit is available to Nokia Developer PRO and Launchpad program members (companies/organizations only). If your company/organization does not have a membership yet, not to worry -> we are offering a 1 year Nokia Developer Launchpad subscription FREE OF CHARGE. Go here and register.

 

 

NFC webinar scheduled

jures33 | 27 September, 2011 11:20

We have announced an NFC focused webinar for developers, ideal to get you started with NFC development.

DATE: October 11th 2011
Time: 10 a.m CET + 1 ( covert into your own timezone )


Getting Started with NFC on Qt

Near Field Communication (NFC) is a short-range wireless-connectivity technology that is rapidly gaining traction among mobile phone users around the world, adding exciting and creative new possibilities for developers. Find out more about this technology, how it is implemented in Nokia phones, and how to use the Nokia Qt SDK to leverage NFC in your applications. The webinar will provide a general NFC introduction, supply practical examples, and explain how to get started with your first NFC app-development project using the Qt SDK.

Register: http://www.developer.nokia.com/info/sw.nokia.com/id/8f874ad1-b55b-4b36-bfba-e999dc727270/getting_started_with_nfc_on_qt.html


Hope to see many of you there!

NFC use cases summarized

jures33 | 23 September, 2011 12:12

So, what can one do with NFC technology and what are the related standards that ensure interoperability across devices?

Well given the fact that it is a shortwave technology that operates at very close distances (up to 10 cm in theory but as implemented in devices the distance to get a good reading is just few centimeters) it inherently means that it requires a the users to do something specific with the device (expressing intent). In Nokia we describe this gesture as a "Tap". In its essence it means users using their phone by almost touching it with another NFC related object to accomplish an action.

Below I describe a few use case families that we try to group these actions and related standards

Tap to share

This family of use cases is all about users exchanging content using two NFC enabled devices/phones in so called peer-2-peer mode. The information exchanged can be either content or small objects. 

The exchange relies on LLCP (Logical Link Control Protocol) defined in NFC Forum so that developers can implement sharing with multiple device types coming from various manufacturers (provided that they are NFC Forum compliant).  Sharing of content can be 2 users exchanging a photo, video, file using NFC as a signaling channel to connect the devices via a secondary bearer (like Bluetooth or WLAN) information and do the transfer over it automatically.

The second area of use cases is more application centric, allowing applications to exchange objects between each other to perform operations. The objects can be simple contact, social profile information, unlock level object, virtual currency, game objects and much more. Furthermore these objects can be standardised so they become application agnostic. The SNEP (Simple NDEF Exchange Protocol) is the NFC forum Standard covering these use cases.  

Tap to initiate a service 

Here we are talking about using your NFC mobile phone in the context of interacting/tapping passive NFC tags. The tags, a small and inexpensive IC, can be embedded in a product (i.e. consumer HW, toys, other consumer goods), in a poster/sticker, in a business card or badge, and all sorts of other ingenious ways. The expectation is that when user is tapping such a smart product (which usually needs to have a visual indication on where to tap it) a service will be initiated automatically.

What kind of service? The most common service is automatically launching a predefined URL (to show product information, to automatically connect, to follow on Twitter, check-in to a service, like on Facebook). Furthermore the use cases can be sending an automated SMS (SMS - info, ticketing, entertainment services etc.), get vCard information or the tag contains application specific code (i.e. unlock hidden levels in a game, get a voucher). An NFC tag can contain multiple information (multiple NDEF records), for instance application specific code (i.e. to unlock levels) and a generic URL record (to download the application from the application store). 

What type of information NFC devices expect/can read from NFC tags is summarised by the RTD (Record Type Definition) specification and how the data is stored on the tag is defined by NDEF (NFC Forum Data Exchange Format) specification.

Tap to pair

Here we are talking about devices using NFC to easily establish connection with each other using a secondary bearer such as Bluetooth. This case applies to easy and convenient way of pairing of devices such as headphones, speakers, printers, computers and other HW allowing the tap gesture (=intent) to replace discovery, PIN exchange and setup steps otherwise necessary to perform the pairing of devices. The related standard that governs this kind of use cases is the NFC Forum Connection Handover Specification

Tap to pay/gain access

This family of use cases is mostly related to (secure) transactions such as ticketing and payment. In this case the device acts as a smartcard and when tapped together with a NFC reader (say a POS payment terminal, a security/access check gate or a transport reader) user performs a transaction (pays for goods/services, opens gate/door, validates train ticket etc). These use cases require that the information is stored (and provisioned) securely to the Device. In NFC jargon we are talking about a Secure Element - a tamper proof storage, ideally physically isolated as a chip embedded on the device HW, integrated into a SIM card or available as a SD card .

When a user touches an NFC reader to perform a transaction the reader needs to read the secure information (card number, status, value of credit, credentials etc) via NFC radio and a secure protocol - called SWP (Single Wire Protocol). 

This is by far the most complex family of use cases to implement. In many cases it involves several stakeholders i.e. HW manufacturer, service provider, trusted service manager, banking system and other players to make it work. Recently players in the industry also started working on solutions using peer-2-peer protocols/architectures using LLCP (i.e. Google Wallet)

This is in a nutshell NFC use case families that we are thinking about in Nokia, most certainly there are more that we haven't thought of yet so we would not like the community to limit themselves to this when thinking how NFC can benefit their business/cause, but rather provide a frame on how the differend standards that ensure interoperability were designed.

NFC is here with Belle, MeeGo and Anna

jures33 | 07 September, 2011 11:48

Wow! What a time for Nokia and NFC!

Symbian Belle, 3 brand new smartphone models, all with NFC technology inside, Symbian Anna update available for C7 and N9 availability just around the corner! That's 5 devices all scheduled to be available on the market this quarter.

 Really goes to show our commitment to NFC and working on the »chicken and egg«* problem so many in the industry are referring to as being one of the challenges stifling NFC takeoff in recent years.

As mentioned by one of our senior spokespersons we believe in a gradual approach with focus on enabling simple use cases connected to NFC tags, Easy device pairing and peer-2-peer interactions with support for the »card emulation« use cases (used to enable mobile payments and ticketing) introduced later on.

More on the NFC use cases later. If you have been playing with C7, C7 Oro or C7 Astound with Symbian Anna you will notice quite a few improvements in the NFC experience we introduced in Symbian Belle.

I personally like the move from a dedicated NFC Sharing application (where you needed to open a special app to share contacts and media) to instant sharing of contacts and photos. Also what we've done in the new models was improve antenna performance, we preloaded games and apps taking advantage of NFC as well as put NFC tags into the sales box to teach customers the new behaviour paradigm  (tap) – what (in this person's opinion) NFC is all about.

Not to make existing C7 customers unhappy, we will make all of the SW level improvements available to them via the upcoming Symbian Belle upgrade (unfortunately one cannot upgrade antenna improvements :( ).

With this I would like to welcome you to this newly created blog on NFC technology where we will give you more information on what\s happening around NFC and Nokia and how best to leverage this technology as a developer. Your questions and opinions matter, so do raise them in the comments section and we'll try to address them in subsequent entries..

Also we started creating a section on the developer portal on NFC: http://developer.nokia.com/Develop/NFC . Be sure you bookmark it if you are interested in developing NFC enabled apps! We are going to update it regularly with news, docs, examples and most importantly tools to get you started with NFC development.

Next time we'll be talking use cases with NFC and also go into more techie side of things on how to develop apps with NFC. For now we leave you off with a nice introductory video from the Symbian Belle device launch featuring the core NFC use cases that come with it.

Enjoy!

* - The "chicken and egg" problem is referring to service providers hesitant to roll out NFC enabled services (smart posters, device pairing, payment & ticketing) due to lack of NFC capable mobile handsets on the market and on the other hand device manufacturers hesitant to add NFC into their devices due to lack of available NFC available services for customers.

Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved