2Developing NFC Applications with Android

NFC applications can be developed in the three NFC operating modes (see section 1.3.2):

  • – in the reader/writer mode, the NFC smartphone acts as an active initiator terminal (generating RF fields as power supply) to read and encode a passive target NFC tag;
  • – the P2P mode allows communication between two NFC-enabled devices: they can exchange data by being both initiator and target in turn (in active/active or active/passive mode) thanks to the LLCP layer (see section 1.3.4.1) and its management of collisions;
  • – in the card emulation mode, the passive NFC-enabled target device behaves as a smart card; in this specific mode, the smartphone can host one or several terminal applications executed in the host OS environment, which can act as the user interface and/or as intermediate application (proxy) to interface with a remote system, and one or several services executed in the SEs secure environment (see section 1.3.2.2).

An NFC smartphone or tablet can act as a reader/encoder of NFC tags in the reader/writer mode. In the P2P mode, the smartphone can also exchange data with another NFC device. In the card emulation mode, the smartphone can act as a contactless NFC smart card (with a SE or an HCE service) to be “read” by an NFC reader.

This chapter introduces mobile applications programming on the Android platform in the three NFC modes, including the HCE mode.

NOTE.– In this chapter, we provide a brief introduction to Android application ...

Get The Art and Science of NFC Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.