I am using DownloadManager service to download files. I want it to resume the download if it is failed by any case(for example internet got disconnected). I am saving the download id generated when we enqueue the request for download. Can I resume download using that id? Or with any other method?
EDIT: Code of my Download Service: http://pastie.org/8613353
It's good habit to check documentation first. DownloadManager documentation says:
The download manager will conduct the download in the background, taking care of HTTP interactions and retrying downloads after failures or across connectivity changes and system reboots.
Thanks to @Marcin's suggestion, I checked the documentation for DownloadManager. The problem with the link I posted was that it was not having resume capability. That's why after it failed due to internet disconnection, it won't resume. I tried other links with resume capability, and they all resume perfectly after internet re-connection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With