0

Is there any way to get some device id or unique & fixed id on P2P communication through NFC devices?

I'm trying to get some unique id which I can check later if that was the same device or not. Right now I'm getting random id on each tap which is very difficult to identified the same device.

Thanks, Gaurav Kapoor

Gkapoor
  • 840
  • 1
  • 13
  • 27

1 Answers1

1

On Android not unless you install your own App that does Host Card Emulation and returns a unique ID.

For NFC the ID is designed only to prevent card clash when 2 Cards are presented to a NFC reader at the same time and thus don't need to be unique, just likely to be different and does not need to be static.

Thus Android OS generates a random number each time as a security precaution against it being used to track phones.

Andrew
  • 8,198
  • 2
  • 15
  • 35
  • Please help me how can I achieve the following solution: Install NFC enabled android device on entry and exit gate.. User taps the entry gate device with his/her android device, saves some unique id and checks at exit gate If the user checks out or not? and initiates the payment based on the number of hours the user stays. – Gkapoor Jan 31 '22 at 13:48
  • 2
    It would be much better for you to work with a proper payments terminal hardware, then you could support iOS and Android phone with there wallet apps and also contactless bank cards, instead of just Android phone as anything you implement won't be secure. But if you really want so many limitation then look at Android HCE https://developer.android.com/guide/topics/connectivity/nfc/hce – Andrew Jan 31 '22 at 14:11
  • Thanks Andrew!! If I ignore payment then Is there any way I can make my Android device as NFC reader and if someone tap their iOS or Android device with my NFC reader device I can capture some unique id and use it later for exit entry? – Gkapoor Jan 31 '22 at 16:58