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):
- MIFARE Classic: the memory sectors are protected by 2 keys. One key can be configured for read-only, while the other can be used to write the memory. NB: not all Android devices can access these!
- MIFARE Ultralight C: can provide additional password protection to prevent overwriting
- MIFARE DESFire: multiple authentication keys and access rights can be configured, including read-only access without keys
- ICODE SLI(X)-S: can provide additional password protection to prevent overwriting
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.