Android Question Sending UDP "Packets" of a file

Douglas Farias

Expert
Licensed User
Longtime User
hi all
I want to send from my Android to my PC via UDP "packets" of 4096 bytes of a file in Base64-Strings.
Example:
The file has 20000 bytes...
It will send a string from 0 to 4096 bytes of the file.
Then send from 4096 to 8192 bytes...
Then send from 8192 to 12288 bytes...
Then 12288 to 16384 bytes....
And finally 16384 to 20000 (Cutting the last 480 bytes).
(All these bytes must be sended in BASE64-Strings)

I have tried it with several ways and I don't figure out, how to make this work.
Can anyone help me how to do this?
I already have figured out, how to send with UDP, but not, how to read in "packets" of 4096 bytes of a file. Maybe with a Loop or something?...

Thanks in advance
 

Douglas Farias

Expert
Licensed User
Longtime User
Hi Erel,
But how can I realize this anyway? I want using UDP...

we is trying to make a conection client/server for a game
and for game later many search we found the udp is best way to make game conection
Thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…