Italian NFC: leggere il TAG ID per tag non formattati

fabio55

Member
Licensed User
Longtime User
Sono in grado, con la libreria NFC 1.25, di leggere il TAG ID quando è anche presente del testo scritto. Ma quando il TAG non è formattato non riesco neanche a rilevarlo. Potreste aiutarmi? Magari e' un problema del manifesto? Io sto usando:
AddActivityText(main, <intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain" />
</intent-filter>)
Qualcuno puo' aiutarmi?
 
Last edited:

abcroverix

Member
Licensed User
Longtime User
Ciao,
ho il tuo stesso problema.
Con quella libreria riesco a leggere solo gli UID del tag ICODE, ma dei mifare, dice che il tag non è riconosciuto.

Ho provato allora questa libreria con l'esempio allegato. Cerca nel forum NFC Tagwriter and iBeacon libraries for free.
Riesco a leggere gli UID dei vari tipi di tag che ho.
L'esempio è scritto con la versione 3.8 di android e l'ho modificato così, per leggere l'UID (cerca e aggiungi la libreria ByteConverter):

Sub Activity_Resume
Dim BTC As ByteConverter

'you need to catch the NFC stuff in Activity Resume because NFC events by the device are external activities
Try
NFCTagWriter.EnableForegroundDispatch
Dim nfcIntent As Intent
nfcIntent = Activity.GetStartingIntent
If nfcIntent <> Null Then
Dim Tag As RSNFCTag
Tag = NFCTagWriter.getTag(nfcIntent)

Msgbox(BTC.HexFromBytes(Tag.Id) ,"ID")

' If Tag.IsInitialized = True AND Tag <> Null Then
' ProgressDialogHide
' If Write(Tag, txtTag.Text) = True Then
' NFCTagWriter_Success
' Else
' NFCTagWriter_Error(LastException.Message)
' End If
' End If
End If
Catch
Log(LastException.Message)
End Try

End Sub
 

fabio55

Member
Licensed User
Longtime User
Grazie per il suggerimento ma la lettura sembra avvenire solo dopo che il TAG è formattato..
 
Last edited:
Top