Hi Erel, thanks for helping me out with the other issues i was having, now i have another question, when i receive the data being trasmitted from my desktop i only receive 128 bytes, the image files i'm transmitting vary in size, but for some reason i only receive 128 bytes every time, can you help me again by giving me some tips on how to receive all the information so that i can save the data into a text file and reconstruct the image on my phone,
i'm using this to receive the data packets
thanks Erel,
i'm using this to receive the data packets
B4X:
Sub UDP_PacketArrived (Packet As UDPPacket)
imageview2.Initialize("imageview2")
msg = BytesToString(Packet.data, Packet.Offset, Packet.Length, "UTF8")', Packet.Offset, Packet.Length, "UTF8")
msg1 = helper.DecodeBase64(msg)
'msg = (Packet.Data)', Packet.Offset, Packet.Length)
'header = Regex.Split("~", msg) 'split incoming data at "~" and end up with 2 items
screenheight = 1024'header(0) 'extract first item of message = screenheight
screenwidth = 800' header(1) 'extract second item of message = screenwidth
phoney = lv.Height 'get phone's screen resolution = height
phonex = lv.Width 'get phone's screen resolution = width
scaley = screenheight / phoney 'calculate scale for y
scalex = screenwidth / phonex 'calculate scale for x
'label1.Text = msg'"H: " & screenheight & " W: " & screenwidth
'imageview2.Bitmap = GetBitmapFromByteArray.Initialize2(msg)
Dim InputStream1 As InputStream
InputStream1.InitializeFromBytesArray(msg1, 0, msg1.Length)
Dim bitmap1 As Bitmap
File.WriteString(File.DirRootExternal,"testimage.txt", msg)
Dim o As OutputStream
o.InitializeToBytesArray(msg1.length)
o.WriteBytes(msg1, 0, msg1.Length)
InputStream1.Close
'bitmap1.Initialize2(InputStream1)
'imageview2.SetBackgroundImage(bitmap1)
End Sub
thanks Erel,