Android Question NFC writing to blank card

hung

Active Member
Licensed User
Longtime User
Perhaps this is NFC question instead of B4X question.

I have a blank NFC card with TagTechnlogy: android.nfc.tech.NfcA, android.nfc.tech.MifareClassic, and android.nfc.tech.NdefFormatable.

I modified from Erel's program below, trying to write to this blank card but found nothing is written to the card. Any hints?


The code changed is as below, where gnfc_mode = 2 for writting = 1 for reading.

B4X:
                Dim techs As List = gnfc.GetTechList(intentstart)
                If gnfc_mode = 1 And techs.IndexOf("android.nfc.tech.Ndef") > -1 Then
                    gnfctech.Initialize("NFCTag", "android.nfc.tech.Ndef" , intentstart)
                    gnfctech.Connect                   
                else if gnfc_mode = 2 And techs.IndexOf("android.nfc.tech.Ndef") > -1 Then
                    gnfctech.Initialize("NFCTag", "android.nfc.tech.Ndef" , intentstart)
                    gnfctech.Connect
                else if gnfc_mode = 2 And techs.IndexOf("android.nfc.tech.NfcA") > -1 Then
                    gnfctech.Initialize("NFCTag", "android.nfc.tech.NfcA" , intentstart)
                    gnfctech.Connect
                else if gnfc_mode = 2 And techs.IndexOf("android.nfc.tech.NdefFormatable") > -1 Then
                    gnfctech.Initialize("NFCTag", "android.nfc.tech.NdefFormatable" , intentstart)
                    gnfctech.Connect

The program "WriteNdef" runs but no data written to the card.

If I use other NFC tool to write data one time, then I could read and write to that card.
 
Top