I am looking at the following code trying to figure away to us it and send the image over to another app across tcp.
I have a open socket and I have no problem sending simple text back and forth between apps.
would i just use

B4X:
Sub Camera1_PictureTaken (Data() As Byte)
Dim out As OutputStream
out = File.OpenOutput(File.DirRootExternal, "1.jpg", False)
out.WriteBytes(Data, 0, Data.Length)
out.Close
ToastMessageShow("Image saved: " & File.Combine(File.DirRootExternal, "1.jpg"), True)
End Sub
I have a open socket and I have no problem sending simple text back and forth between apps.
B4X:
Sub Server_NewConnection (Successful As Boolean, NewSocket As Socket)
If Successful Then
Socket1 = NewSocket
tw.Initialize(Socket1.OutputStream)
tw.Writeline ("OK,Connected!,")
tw.Flush
AStreams.Initialize (Socket1.InputStream, Socket1.OutputStream, "AStreams")
Else
ToastMessageShow(LastException.Message, True)
End If
Server.Listen
End Sub
would i just use
B4X:
tw.write (data)
tw.flush