0

I have to download a file and show the progress as the download starts. In the mean while user can go to any other activity.So, i think the best way is to download with the help of service.

But how to send the progress update.

I got this code

Sameer Z. answer to download from service

but how to show the progress.

Community
  • 1
  • 1
zaiff
  • 999
  • 2
  • 13
  • 29

2 Answers2

1

You can design a custom notification, which will show the progress in the notification bar. That is the best way to show download progress if downloading from a service.

What you want is here: http://united-coders.com/nico-heid/show-progressbar-in-notification-area-like-google-does-when-downloading-from-android Also check : http://developer.android.com/guide/topics/ui/notifiers/notifications.html#CustomExpandedView

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
Akhil
  • 13,888
  • 7
  • 35
  • 39
-1

AsyncTask will solve your problem

See this link: Threads, Handlers and AsyncTask

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
Sadeshkumar Periyasamy
  • 4,848
  • 1
  • 26
  • 31