Thank you at all for the help.
For my project I am forced to use async because I have to read and write a st25dv for which there is a specific sdk that I use for reference. In this memory I have to read and write data that are protected by password and crc. We chose B4A because there is already a software for windows written in Visual Basic that we already.
This is wath I'm doing.
Private Sub B4XPage_Appear
nfc.EnableForegroundDispatch
Dim si As Intent = B4XPages.GetNativeParent(Me).GetStartingIntent
If si.IsInitialized = False Or si = prevIntent Then Return
prevIntent = si
Dim jo As JavaObject = TagTech
Dim tag As JavaObject = jo.RunMethod("getTag", Null)
Dim rawId() As Byte = tag.RunMethod("getId", Null)
Log(bc.HexFromBytes(rawId)) 'bc = ByteConverter
If si.Action.EndsWith("TECH_DISCOVERED") Or si.Action.EndsWith("NDEF_DISCOVERED") Or si.Action.EndsWith("TAG_DISCOVERED") Then
Dim techs As List = nfc.GetTechList(si)
Log($"Techs: ${techs}"$)
'in this case we are only accessing NfcV tags.
If techs.IndexOf("android.nfc.tech.NfcV") > -1 Then
TagTech.Initialize("TagTech", "android.nfc.tech.NfcV" , si)
'Connect to the tag
TagTech.Connect
TagTech.RunAsync("TT", "transceive", Array(Array As Byte(0x10,0,0,0xb0,0xFF)), 0)
Wait For TT_RunAsync (Flag As Int, Success As Boolean, Result As Object)
Else
toast.Show("Tag does not supported.")
End If
End If
End Sub