开发者

Download big files from android, with a recovery on error

开发者 https://www.devze.com 2023-02-16 04:27 出处:网络
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 stan

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 work开发者_如何学Pythoning code. :-) Thanks


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消