6
votes

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

2
Found the answer, the link was not having the resume capability. That's why it wasn't resumed.berserk
Hi Berserk, can you please share what was the solution to this problem, it ll b e helpful.Thanks in advance!Shalini
@Andy Thanks to Marcin's suggestion, I checked the docs and found that this link doesn't have the resume capability. That's why it didn't resume. I posted this as an answer too.berserk
thanks for the reply :) saved my timeShalini
@Andy Glad it helped :)berserk

2 Answers

1
votes

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.

1
votes

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.