F flylg999 Member Licensed User Longtime User Jun 24, 2024 #1 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: Jun 24, 2024
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!
Erel B4X founder Staff member Licensed User Longtime User Jun 24, 2024 #2 flylg999 said: 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). Click to expand... Start with the example: https://www.b4x.com/android/forum/threads/nfc-reading-and-writing.64451/ It lets you overwrite the records. Upvote 0
flylg999 said: 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). Click to expand... Start with the example: https://www.b4x.com/android/forum/threads/nfc-reading-and-writing.64451/ It lets you overwrite the records.
F flylg999 Member Licensed User Longtime User Jun 24, 2024 #3 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: Copy 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
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: Copy 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.