Android Question NFC 2.01 & Android 7.0

MarcoRome

Expert
Licensed User
Hi @Erel, All
I have a App that work without problem with Android 5 and 6, but with Android 7 i have this message:

Tag does not support Ndef.
In log if i try with Android 6 i have this:
Techs: [android.nfc.tech.NfcA, android.nfc.tech.MifareUltralight, android.nfc.tech.Ndef]
Connected: true
Reading completed. Success=true, Flag=0
UID: 0453E282D24881
and all work in Android 7 i have this:
Techs: [android.nfc.tech.NfcA, android.nfc.tech.MifareUltralight]
and message

Tag does not support Ndef.
Infact if you see in log the Android 6 work and give me

Techs: [android.nfc.tech.NfcA, android.nfc.tech.MifareUltralight, android.nfc.tech.Ndef]
In Android 7 i have only:

Techs: [android.nfc.tech.NfcA, android.nfc.tech.MifareUltralight]
without "android.nfc.tech.Ndef"

Any solution ??

NOTE: Before I was switched to version 7 the device worked without any problem.
So it is certainly the Android 7
 

MarcoRome

Expert
Licensed User
Found solution:

B4X:
'Here Read Version Android
        Dim p As Phone
        Dim version_droid As Int = p.SdkVersion
        If version_droid > 23 Then
            'in this Case we are only accessing Ndef tags. Android 7
            If techs.IndexOf("android.nfc.tech.NfcA") > -1 Then
                TagTech.Initialize("TagTech", "android.nfc.tech.NfcA" , si)
                TagTech.Connect
            Else
                ToastMessageShow("Tag does not support NfcA.", True)
            End If
        Else    
            'in this Case we are only accessing Ndef tags.  Android 6 or less
            If techs.IndexOf("android.nfc.tech.Ndef") > -1 Then
                TagTech.Initialize("TagTech", "android.nfc.tech.Ndef" , si)
                TagTech.Connect
            Else
                ToastMessageShow("Tag does not support Ndef.", True)
            End If
        End If
 

MarcoRome

Expert
Licensed User
Anyway also if read in correct mode the result ( UID ) i have Success = False

Android 7:
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (act_nfc) Create, isFirst = true **
** Activity (act_nfc) Resume **
** Activity (act_nfc) Pause, UserClosed = false **
** Activity (act_nfc) Resume **
Techs: [android.nfc.tech.NfcA, android.nfc.tech.MifareUltralight]
Connected: true
Reading completed. Success=false, Flag=0
0453E282D24881
Android 6 or minor:
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (act_nfc) Create, isFirst = true **
** Activity (act_nfc) Resume **
** Activity (act_nfc) Pause, UserClosed = false **
** Activity (act_nfc) Resume **
Techs: [android.nfc.tech.NfcA, android.nfc.tech.MifareUltralight, android.nfc.tech.Ndef]
Connected: true
Reading completed. Success=true, Flag=0
0453E282D24881
 
Top