Android Question How to get integer number vi serial communication


Licensed User
Longtime User
I'm using felUsbSerial - Usb Serial library to get intger numbers from
arduino to android (b4a). My problem is that the integers translated to byte vi the serial usb. becuase my project deal with sampling sensor buy arduino I need an effective and fast way to get back my lost integers number.
I will Appreciate any Proposal
thank you


B4X founder
Staff member
Licensed User
Longtime User
Simplest way is to program the Arduino with B4R and use B4RSerializator + AsyncStreams.

Data is always sent as bytes. You can use ByteCovnerter or RandomAccessFile to convert the bytes back to integers. Note that Arduino integers are actually 16 bit numbers which match B4A shorts.
Upvote 0