Reputation: 2012
I wish to Sync or download multiple files from server on user demand in a native android app. I need to update UI about status of the Sync in progress as well. So in this case which of the below android component should be used.
Upvotes: 1
Views: 606
Reputation: 1216
I think that download files your needed with help Service or AsyncTask, and update UI make with help broadcast receiver.
Upvotes: 0
Reputation: 75647
Use AsyncTask
to do your background work and to update UI elements implement onProgressUpdate()
in your task. See docs for details.
Upvotes: 1
Reputation: 8325
Use an AsyncTask
, it is purposely built to do exactly what you are asking. That is
All three options will work, but AsyncTask
will be the easiest and best suited.
Upvotes: 0