Android Question Please HELPme to convert code java to B4A

pcicom

Member
Licensed User
Longtime User
JAVA a B4A:
                   byte CardType[] = new byte[2];
                   byte Atq[] = new byte[14];
                    char SAK = 1;
                    byte sak[] = new byte[1];
                    sak[0] = (byte) SAK;
                    byte SN[] = new byte[10];
                    scanCard = piccReader.request(CardType, Atq);
                    if (scanCard > 0) {
                        SNLen = piccReader.antisel(SN, sak);
                        Log.d(TAG, "SNLen = " + SNLen);

                    }
 

teddybear

Well-Known Member
Licensed User
The simplest way is using javaobject and inline java to call the code snippet
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I don't know what an object it is Piccreader, I suppose you are taught to read a NFC ... for the rest I did the translation
B4X:
Dim CardType(2) As Byte
Dim Atq(14) As Byte
Dim SAK As Byte = 1
Dim sak(1) As Byte
sak(0) = SAK
Dim SN(10) As Byte
Dim scanCard As Int

'piccReader = ??????'
scanCard = piccReader.Request(CardType, Atq)   ' ?????
If scanCard > 0 Then
    Dim SNLen As Int
    SNLen = piccReader.Antisel(SN, sak)  ' ?????
    Log("SNLen = " & SNLen)
End If
 
Upvote 0
Top