Search code examples
androidsecuritynfcnfc-p2pandroid-beam

NFC on Android Application


I'm developing two applications that use NFC on Android 4.3 for peer-to-peer communication, I have three questions about it.

  1. Can NFC on Android exchange data between two applications with only 1 beam? If it can how to do that and if it cannot then why?
  2. How can I get NFC hardware ID? I'm gonna use it for hardware lock/restriction. If NFC do not have ID, then why?
  3. Is NFC communication secure? must I encrypt the data? If it is then why and if I is not then why?

Solution

    1. I'm not quite sure I understand your first question. I assume that you are asking if its possible to establish bidirectional communication between two apps on two different phones. If that's the case, the simple answer is: Beam can't be used to do that. With Android Beam (Android's peer-to-peer mode functionality) you can only send one message in one direction at a time. (Actually you can send one message from each side if your users are good at simultaneously clicking the Beam UI on both devices.)

    2. There simply is no NFC hardware ID. The NFC standard (ISO/IEC 18092) was designed so that devices use random identifiers to protect users' privacy.

    3. No, the NFC interface protocols currently do not implement security features. Encryption/integrity protection/etc. is the responsibility of the application layer. However, there are standards that could add encryption/etc. to lower layers, but these standards are not implemented on current NFC devices.