Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download big files from android, with a recovery on error

I developed an app that have to download very large files, 100 MB average. Everything works, but some times for normal reason like Mobile connection that go down to 0 for some seconds or wireless standby, the download that run in a service (like the update of the market) can be broken or interrupted. There is a way for recovery on error, maybe with an http range? If someone already had the problem will be nice to have an example of working code. :-) Thanks

like image 365
Mauro Rocco Avatar asked Nov 06 '22 01:11

Mauro Rocco


1 Answers

On the server, use "split" on the file to split it into many smaller files, and generate a check file of md5sums with md5sum.

On the android, you'll need to download all the pieces, check the md5sum, go back and get any that didn't download correctly and then cat them together.

I've never done this on the android but have used it many a time with flaky telephone modem connections in the bad old days.

like image 72
Paul Avatar answered Nov 09 '22 08:11

Paul