Reputation: 383
I am trying to use a ContentProvider to download a single, huge zip file to the internal storage using the DownloadManager as mentioned here (see option 2):
Create a ContentProvider which DownloadManager can write to and give it a URI that corresponds to this ContentProvider.
Can someone provide me with an example on how to achieve that? Is this what I'm trying to achieve?
Or is it a totally bad idea to do it this way?
Upvotes: 3
Views: 3288
Reputation: 4344
The answer you posted mentions a couple of scenarios:
Now to add further, no matter what method you choose, code for downloading data would remain same. Perhaps I would suggest a more suitable solution, as ContentProvider are generally related for dealing with databases so drop that, instead
Brilliant code for downloading file below along with usage of power manger etc. can be found here:
Download a file with Android, and showing the progress in a ProgressDialog
Upvotes: 4