Reputation: 697
I need help designing a solution to a problem specific to long running background tasks.
Upvotes: 2
Views: 924
Reputation: 3179
I would suggest to use Android's DownloadManager
. This is the Download manager that the whole OS uses. U'll receive broadcast when the download is completed using ACTION_DOWNLOAD_COMPLETE
.
Try this tutorial:
http://blog.vogella.com/2011/06/14/android-downloadmanager-example/
Upvotes: 0
Reputation: 15678
This allows you to perfom downloads in parallel. In the activity you can show the current progress by polling in a background thread, but I am not sure what you mean with the notification? The DownloadManager shows a notification when starts with downloading.
Your downloads will be much stabler instead of using an own implementation, since DownloadManager can deal with connection loss and will perform a retry.
Upvotes: 3