nilMoBile
nilMoBile

Reputation: 2012

Which one to select: Android Service or Intent Service or Async Task to Sync Files

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

Answers (3)

imperator_sp
imperator_sp

Reputation: 1216

I think that download files your needed with help Service or AsyncTask, and update UI make with help broadcast receiver.

Upvotes: 0

Marcin Orlowski
Marcin Orlowski

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

Jug6ernaut
Jug6ernaut

Reputation: 8325

Use an AsyncTask, it is purposely built to do exactly what you are asking. That is

  • Background work
  • Notify UI during work.

All three options will work, but AsyncTask will be the easiest and best suited.

Upvotes: 0

Related Questions