I have a project with several activities.
The main activity, called Main takes care of a.o. asyncstreamtext. Sending is done as follows
Another activity also has to send some data.I tried to do so, based on sampl code which I do not completely understand, as follows:
The main activity, called Main takes care of a.o. asyncstreamtext. Sending is done as follows
B4X:
Public Sub Send (Mess As String)
If Stream1.IsInitialized = False Then Stream1.Initialize(Me,"Stream1",Client1.InputStream,Client1.OutputStream) 'to Raspberry
Stream1.Write(Mess&CRLF)
End Sub
Another activity also has to send some data.I tried to do so, based on sampl code which I do not completely understand, as follows:
B4X:
Sub sendrequest(text As String)
Dim request As Object= text
Dim jo As JavaObject =request
CallSub2(Main,"send",jo)
End Sub