Martin Woolley and John Murray from our Developer Relations team have been hard at work creating sample applications that illustrate the use of the BlackBerry NFC APIs. Most of these samples are now available at GitHub; the latest addition is to the Samples-for-Java repository (in the NFC directory) and is an application called “NfcTransactionHandler”. This application illustrates key aspects of NFC card emulation.
The other NFC sample applications published to the Samples-for-Java repository to date are:
- NfcReadNdefSmartTag: this application detects NFC smart poster tags, reads their contents and displays details of the tag content.
- NfcWriteNdefSmartTag: a counterpart to NfcReadNdefSmartTag, this application allows you to write any of four types of NDEF message to an NFC tag. The types supported are URI, Smart Poster, Text and Custom (TNF External).
- NfcSnepResponder: illustrates the use of the Simple NDEF Exchange Protocol to effect a peer to peer transfer of data between two NFC devices.
- NfcVirtualTargetFun: Shows how to utilise “virtual NFC target emulation”, a technique which allows a BlackBerry smart phone to emulate in application software, an NFC tag or card.
In addition to the Java NFC sample applications, Martin and John also wrote a Web Works extension which allows Web Works developers to integrate NFC tag reading functionality in their applications. The extension and an example application which uses the extension has been published to the WebWorks-Community-APIs repository in the Smartphone/NFC folder.
As of this writing the series of articles and presentations includes:
- NFC Primer for Developers
- Reading and Writing NFC Smart Tags
- NDEF Tag Reading from WebWorks Applications
- NFC Virtual Target Emulation
- NDEF Message Handling Behaviours
- Peer to peer communication with SNEP
- DevCon Europe 2012 presentation
- NFC Card Emulation Primer