androidnfchcenfc-p2pacr122

NFC Reader <-> Android communication and Android listener


I have some questions about the communication between a NFC reader and an Android phone.

The first subject is the Android / NFC reader modus: What is the best way to pass a unique identifier from the NFC reader (ACR122U) to an Android device? ACR122U in peer-to-peer, card emulation, or reader/writer mode? Wich modus are possible? And what is the best mode if you want bi-directional communication?

The second subject is about the listener on the android device: How can a Android reader trigger an Android application? When you tap your phone on the NFC reader, do you need to have the Android application in the front or do you need to write a NFC listener or something while your application is running on the background?

Many thanks.


Solution

  • What is the best way to pass a unique identifier from the NFC reader (ACR122U) to an Android device?

    That depends on what you want to achieve.

    See this answer for a list of further literature.

    Which modes are possible?

    All three modes are possible but give you different degrees of freedom.

    And what is the best mode if you want bi-directional communication?

    See above, using the ACR122U in card emulation mode and the phone in reader/writer mode will permit bi-directional communication on all Android versions. The phone has the role of the interrogator (in a command-response protocol) in this case.

    If you only want/need to support Android 4.4 and later, you could just as well use the phone in HCE (host-based card emulation) mode and the ACR122U in reader/writer mode.

    When you tap your phone on the NFC reader, do you need to have the Android application in the front or do you need to write a NFC listener or something while your application is running on the background?