0

I am having an android application that download songs from server to device. I am showing a progress dialog for this . I need to show the downloaded size , remaining size , elapsed time and time remaining to the user

How do I get these things from the application in Android?

Any pointers will be most useful.

Regards Renjith

slezadav
  • 6,104
  • 7
  • 40
  • 61
Renjith
  • 546
  • 1
  • 8
  • 28
  • this is exactly what 1AsyncTask` is all about. you should override the `onProgress` and use a `ProgressDialog` – thepoosh Nov 07 '12 at 12:56

1 Answers1

1

You should use async task and override onProgressUpdate()

 @Override
 protected void onProgressUpdate(Integer... values) {
     Log.i("Value", values[0].toString());
     count++;
     progressBar.setProgress(count);
 }

Take a look at this link. Download a file with Android, and showing the progress in a ProgressDialog. The answer in the link should help you.

Calculate Percentage Downloaded and Time Remaining for in OTHER application. What's the best way to calculate remaining download time?

Community
  • 1
  • 1
Raghunandan
  • 132,755
  • 26
  • 225
  • 256