It does not indicate that the library is not working, rather there is an error in the code.Hello ,
I created an app that communicates via tcp with an instrument using also the byteconverter 1.1 library on the android 5 version.
The problem is that it doesn't work with android 9 or higher.
Can you help me please.
thank you
Sub SendHRDmessage(messagee As String)
Dim nSize,nSanity1, nSanity2,nChecksum, nZero, lngt,i As Int
'StringToBytes (bc As String) As Byte()
Dim bc As ByteConverter
Dim header(4) As Int
Dim strMessage, S As String
nZero = 0
strMessage = messagee & " "
bc.LittleEndian = True
lngt=bc.StringToBytes(strMessage,"UNICODE").Length
Dim bytData(lngt) As Byte
bytData = bc.StringToBytes(strMessage,"UNICODE")
lngt = 16 + bytData.Length - 2
Dim byAll(lngt) As Byte
header(0) = lngt
header(1) = 0x1234ABCD
header(2) = 0xABCD1234
header(3) = nZero
bc.ArrayCopy(bc.IntsToBytes(header),0,byAll,0,16)
bc.ArrayCopy(bytData,2,byAll,16,bytData.Length-2)
sHRDanswer = ""
'bCmdDone = False
AStreams3.Write(byAll)
ToastMessageShow(bytData, True)
End Sub
You forgot to post the requested full Errormessage from the log. Post it as Text.I tried simultaneously between android 6 and android 10, in the point where I put the ToastMessageShow to check the output value I get a different value between the two devices
Never debug anything with toast messages. Use logs.What do you think?
bc.ArrayCopy(bytData,2,byAll,16,bytData.Length-2)
Sub GetSDK() As Int
Dim p As Phone
Return p.SdkVersion
End Sub
Sub Activity_Create(FirstTime As Boolean)
GetSDK
ver_phone=(GetSDK)
If ver_phone <24 Then
dimensione_riga=16
Else
End If
If ver_phone >25 Then
dimensione_riga=15
Else
End If
bc.ArrayCopy(bytData,2,byAll,dimensione_riga,bytData.Length-2)