Just trying to get to grips with B4a, though I am proficient in VB6 and ZBASIC code, the android way is a little different but i am enjoying the learning.
I am converting the bluetooth serial example to use astreams as suggested as i couldn't find published complete code, just some extracts.
The receive section using astreams works, and so does the send if i leave it as textwriter but i guess i should use astreams for send too for reasons stated. the problem is more with stringtobytes, this just won't compile
Sub btnSend_Click
Dim strBytes(9) As Byte
If connected Then
strBytes() = StringToBytes(txtSend.Text,"UTF8")
Astreams.Write(strBytes())
'TextWriter1.WriteLine(txtSend.Text)
'TextWriter1.Flush
txtSend.Text = ""
End If
End Sub
i've added the byteconverter library (though i'm, not sure if this is required as the bytestostring call in the receive routine compiles OK without this library for some reason).
i'm sure i'm missing something basic here :signOops: any help much appreciated.