Hi, I'v faced this situation, where I have to pass some parameters to an external jar but some are arrays and others are not.
The java code is :
Now in my B4A I have
and the JavaObject Line would be something similar as the one below, wich obviously does not work.
I've looked java.initialize array, but I could not figure how to use it in this situation.
every different attempts I've tryed always lead me to
java.lang.IllegalArgumentException: Array has incompatible type:
I'me prety sure there is a solution, as always,
Help !
The java code is :
B4X:
public int transmit(int slotNum,
byte[] sendBuffer,
int sendBufferLength,
byte[] recvBuffer,
int recvBufferLength)
Now in my B4A I have
B4X:
Private SendBuffer(6) As Byte
SendBuffer(0)=0x00
SendBuffer(1)=0xA4
SendBuffer(2)=0x08
SendBuffer(3)=0x0C
SendBuffer(4)=0x02
SendBuffer(5)=0x2F
Private recvBuffer(300) As Byte
and the JavaObject Line would be something similar as the one below, wich obviously does not work.
B4X:
Dim response As JavaObject
response=mReader.RunMethod("transmit", Array As JavaObject (slotnum, Array As Byte (SendBuffer()) ,SendBuffer.Length, Array As Byte (recvBuffer()), recvBuffer.Length ))
I've looked java.initialize array, but I could not figure how to use it in this situation.
every different attempts I've tryed always lead me to
java.lang.IllegalArgumentException: Array has incompatible type:
I'me prety sure there is a solution, as always,
Help !
Last edited: