B4X:
@BA.ShortName("RandomAccessFile")
@BA.Version(1.3F)
yesterday I have wrote a bluetooth communication app when I call write2 the other device can not receivedany message,But when I call write it works fine!Then I had to wrote a simply function to spilt the bytes
B4X:
Sub bytebuild(buf() As Byte,start As Int,length As Int) As Byte()
Dim strTmp As String
Dim bytes(0) As Byte
If buf.length<length Then Return bytes
strTmp=BytesToString(buf,start,length,"UTF-8")
bytes=strTmp.GetBytes("UTF8")
Return bytes
End Sub
B4X:
public boolean Write(byte[] Buffer)
{
return Write2(Buffer, 0, Buffer.length);
}
public boolean Write2(byte[] Buffer, int Start, int Length)
{
return aout.put(Buffer, Start, Length);
}
what's wrong with me? serial connect and listen by "connect and listen" the other code haven't be modify