NFC development
The NFC technology is of special interest for developers because NFC allows several new possibilities to interact with devices. Due to well-defined standard formats NFC can be integrated into existing systems quite easily. In the following guide we will explain a few basics about developing with NFC and then discuss details related to different platforms.
What is possible with NFC?
Basically, NFC allows for contactless communication within a reach of a few centimeters (0-8 cm). Communication takes place either between two NFC-enabled devices or between NFC device and NFC tag. Both applications have their own strengths in different scenarios which are presented below:
Communication between two NFC-enabled devices
Communication between two NFC-enabled devices is also referred to as peer-to-peer mode (P2P). As both devices have an own energy source the peer-to-peer mode allows for free data exchange between them. However, it’s required that both devices “understand” the communication, so a suitable application must be installed on both devices. Typical applications are for example:
- Exchange of key pairs to initiate an ad-hoc WiFi connection (Android Beam)
- Contactless payments where a NFC-enabled pay terminal communicates with a NFC-enabled smartphone
SDKs of most platforms offer at least basic functions for peer-to-peer mode. However, the development of applications based on peer-to-peer mode require more effort than the development of applications which allow the communication between NFC-enabled devices and NFC tags. Moreover, all supported devices should be tested thoroughly to detect platform-specific errors. Nevertheless, peer-to-peer applications are very useful because they allow for flexibility of the transmitted data.
Communication between NFC-enabled device and NFC tag
Applications for the communication between NFC-enabled device and NFC tag enable the device to read and interpret stored data on NFC tags. Basically, a NFC tag is a data storage which can be encoded and read by NFC-enabled devices. During the development process, it has to be decided if data should be stored in a standardized format (NDEF) or in a proprietary format. Summarized, the following data types exist:
- Standardized NDEF types (URL, text, vCard): NDEF data types can be interpreted by every device supporting the NDEF format. More specifically, the NDEF data type functions as trigger which enables the scanning device to automatically execute a corresponding action (e.g. open a website if a URL is stored)
- NDEF with own MIME types: It’s possible to define NDEF data types on your own and to register a corresponding developed application in the system. Then, this application is always executed if a tag of the corresponding MIME type is scanned.
- Proprietary formats: The data are stored in another format than NDEF. The corresponding application reads and interprets the data autonomously. The use of proprietary formats requires direct access to the hardware level of the NFC chip.
What do you need for the development of NFC applications?
In order to get started with NFC development you need suitable NFC-enabled devices or alternatively universal readers and of course NFC tags. In case you’re planning to develop peer-to-peer applications a second NFC-enabled device is needed.
NFC-enabled devices for development – smartphones
A NFC-enabled device has an active transmitter which is able to communicate in the HF 13.56 MHz area and complies with the ISO 14443 standard. Check our list of NFC-enabled smartphones for an overview.
If you have more than one suitable NFC device at hand, you can use one to emulate NFC tags. A cheaper alternative would be to actually use NFC tags.
NFC-enabled devices for development – USB readers
NFC USB reader allow for the development of NFC applications which are independent of software platforms. As NFC USB readers support the Personal Computer/Smart Card (PCSC) standard, the NFC communication can take place platform-neutral. The application can be ported to the target system later on.
NFC tags for development
NFC tags are passive transmitters for Near Field Communication which means that they don’t have an own energy source. Therefore, NFC tags can only transmit data if they are close to an active NFC-enabled device (1-4 cm).
NFC tags are well suited for experiments and NFC development because you can encode and re-write them up to 10.000 times. Our NFC Starter Kits are the ideal choice to get started with NFC development because they contain a wide variety of NFC tags (e.g. different amounts of memory capacity, different built-in chip types, various forms and sizes).