I have severals URL
s I need to get data from, this should happen in order, one by one. The amount of data returned by requesting those URL
s is relatively big. I need to be able to reschedule particular downloads which failed.
What is the best way to go? Shall I use IntentService
, Loaders
or something else?
Additional note: I would need not only to download, but also post process the data (create tables in db, fill it with data, etc). So DownloadManger
can't be of help here.
I would use an IntentService
.
It has a number of advantages that are suitable for your needs, including being able to download the data without your application running and supporting automatic restart of the service using setIntentRedelivery()
.
You can set a number of identifiers for the particular job, you need to perform using Intent
extras, and you can keep track of the progress using SharedPreferences
- that way you can also resume the work if it's been cancelled previously.
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