Android Question astream read?

merlin2049er

Well-Known Member
Licensed User
Longtime User
I've got this code I'm using to write data to my arduino - it works fine...
Everything else, connecting, initializing bt, works...

I'm using the same code to send streams now to another android device

B4X:
Sub SendData(data As String) 'send data to your android device
    If data.Trim <> "" Then
        Log(data)
        AStream.Write(data.GetBytes("UTF8"))
    End If
End Sub


On the receiving side? Not clear on how to read this stream, and make use of it.
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
Can you bring the buffer as a string or do u need to do it a byte at a time?

Is this possible...

sub Astream_NewData(buffer () as string)

do stuff here...

End sub
 
Upvote 0
Top