I have an app that design personalized tags that, when it is detected by an android phone, launches another app with some content. It all works fine and I know how to make a read only nfc Tag. The problem is, I would like to make a NFC Tag only readable by users of the other app. But I also want , if necessary, modify these tags in order to be rewritten. But I want to prevent from users to do themselves. that's why a ndef.makeReadOnly() is not appropriate for me..
does anyone can help me ???
Yes of course but Android API don't have ready-made method to do it. You have to use APDU to control access to tag. The Ndef class has a makeReadOnly method: http://developer.android.com/reference/android/nfc/tech/Ndef.html#makeReadOnly() but you can't unlock tag.
NFC Tags are rewritable by default. Potentially, the NFC Tag can be rewritten endlessly.
By default, the memory of the NFC Chips is rewritable, but can be set in the "read only" mode. In this case, the Tag is also called "locked" and can no longer be overwritten. Some Chips also support password lock. This means that a Tag locked with a password can only be reprogrammed by someone who knows the password.
It depends somewhat on the exact tags you will be using. The standard NFC Forum tag types for storing NDEF messages that Android supports have no specific functionality defined for this. So the Android API does not provide it either. There is only makeReadOnly()
, which in most cases makes the tag irreversibly read-only.
However, when you look at the chips inside the tags that actually implement the required NFC functionality, they often provide more functions. These extra functions may include access control for writing, allowing the chip to be configured like you want.
Some examples (all manufactured by NXP, as I am most familiar with those):
Most of these tags are generally available for sale on-line. You will have to hunt a bit on the internet to gather all the information on how the configuration has to be done, though. There is PC software available in most cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With