Android Question NFC : How to clear all NdefRecord, format data area

flylg999

Member
Licensed User
Longtime User
nfc.GetTechList(si) ==> [android.nfc.tech.NfcA, android.nfc.tech.Ndef]

TagTech.Initialize("TagTech", "android.nfc.tech.NdefFormatable" , si) ==> error: java.lang.RuntimeException: Object should first be initialized (TagTechnology).

but NFC tools Can format it. then , How to clear all NdefRecord , format data area?

thanks!
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

flylg999

Member
Licensed User
Longtime User
Thanks for Erel's replay.
I write a TNF_EMPTY record to overwrite , But the data is still there , and the datasize is 4 bytes
some nfc tools "ndef data area format" makes data to 0x00

B4X:
    Dim AA As JavaObject
    Dim b = 0 As Short
    AA = AA.InitializeNewInstance("android.nfc.NdefRecord", Array(b,Null,Null,Null))
......

or I can make a big (< getMaxSize ) "createTextRecord " to overwrite it.:)
 
Upvote 0
Top