Reading Tag ID using NFC.

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Googie85
Posts: 199
Joined: Tue Aug 05, 2014 10:07 am

Reading Tag ID using NFC.

Post by Googie85 » Fri Feb 10, 2023 7:10 am

Good Evening!

I was wondering if it is possible to read the unique ID of a NFC Tag? Rather than reading a NDEF record on the card.

I hope I have explained clearly.

Many Thanks,

Googie.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7238
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Reading Tag ID using NFC.

Post by jacque » Fri Feb 10, 2023 9:01 pm

When a tag is scanned you should get a message "nfcTagReceived". Write a handler to catch that message. The single parameter is an array containing the tag data.

Code: Select all

on nfcTagReceived pTag
  put pTag["id"] into tTagID -- extract hardware ID
  ...
end nfcTagReceived
The ID will be binary, you can convert it to ascii for human-readable text if you need to:

Code: Select all

get binaryDecode("H*",pTagID,tAsciiTag) 
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Android Deployment”