Rahul
Rahul

Reputation: 749

Any way to resume download from last break point Android?

I am making a download manager for my app. It works fine, but as soon as network fluctuates, I have to press retry button and it starts downloading from the beginning again. Any way to resume it from last break point?

Thanks, Rahul

Upvotes: 0

Views: 559

Answers (2)

JasonOfEarth
JasonOfEarth

Reputation: 739

As the documentation (http://developer.android.com/training/volley/index.html) says

Volley is not suitable for large download or streaming operations, since Volley holds all responses in memory during parsing. For large download operations, consider using an alternative like DownloadManager.

However you could use the volley calls to download your big file in chunks, then when you have server instability you could just request the chunks you don't have. Note this is generally a bad idea as you're basically recreating tcp and you shouldn't do that.

Upvotes: 1

Abhishek Jain
Abhishek Jain

Reputation: 315

create a temporary directory and store the fragment of the files that is being downloaded. after downloading concatenate the files.

Upvotes: 0

Related Questions