问题
I'm actually trying to emulate a NFC card with my android smartphone(on 4.4) and send this information to my NFC reader witch is connected to my Java Application. The goal is to catch an unique ID but my NFC reader do not support peer-to-peer.
So the example on https://developer.android.com/guide/topics/connectivity/nfc/hce.html do not work.
Thanks for your assistance
回答1:
Peer-to-peer mode and Android HCE are two different things. In order to access devices with Android HCE, your reader only needs to support contactless smartcards (i.e. ISO 14443-4 + ISO 7816-4). If your reader is connected to your Java application using the Java SmartcardIO API this is likely the case.
Regarding a unique identifier: With Android HCE, the serial number used during the anti-collision sequence of the ISO 14443 protocol (e.g. UID, PUPI) is random (typically a new value for each protocol activation). So the only way to get a unique identifier over Android HCE would be to define such an identifier within your HCE application and to query your application for this ID using a custom ISO 7816-4 command(-sequence).
来源:https://stackoverflow.com/questions/22983446/nfc-host-card-emulationhce