I’m developing an android application to write to a specific memory location of a nfc tag.
And I need to get the maximum size of NDEF message payload from reading an NFC tag, so that I can define memory location within that range.
I know that it is able to get the whole ndef memory size by the code below:
Ndef ndef = Ndef.get(tag);
int size = ndef.getMaxSize();
Are there any approach to get the maximum payload size?
Any help would be much appreciate!
the max payload size allowed by the spec is 2^32-1
http://developer.android.com/reference/android/nfc/NdefRecord.html
you can get the variable-length payload and its size with getPayload