Download large files from android with error recovery

I developed an application that should download very large files, medium 100 MB. Everything works, but several times for a common reason, such as a mobile connection that switches to 0 within a few seconds or in standby mode in standby mode, the download performed in the service (for example, updating on the market) may be broken or interrupted. Is there a way to recover from an error, possibly with a range of http? If someone already had a problem, it would be nice to have an example of working code. :-) Thanks

+5
source share
1 answer

On the server, use the β€œsplit” in the file to split it into several small files and create the md5sums verification file using md5sum.

On android, you will need to download all the parts, check md5sum, go back and get everything that did not load correctly, and then hide them together.

I never did this on android, but used it many times with broken phone modems in the bad old days.

+2
source

All Articles