Would your suggestion actually work? I'm not convinced it's that simple. You still wouldn't see the progress bar appear on the screen, much less update smoothly on demand, because you would be constantly tying up the UI thread. I think you need to create the progress bar on the main UI thread, set up its max, init its val to 0, then make a separate thread that reads the file and occasionally sets the progress bar's "progress" to a new val (you can do that from a nonUI thread apparently, works for me).
On May 26, 5:48 am, MrChaz <[email protected]> wrote: > You can ask a URLConnection for the content length and then read from > the content stream in chunks. > > You can display your progress by setting the max to the content length > and then incrementing the progress by your read chunk size. > > On May 26, 1:21 pm, Sukitha Udugamasooriya <[email protected]> wrote: > > > Hi, > > > I m implementing a small app which downloads files (avg 1MB files- > > takes 5 seconds to download). > > --> I want to show the progress using a ProgressBar. > > -->The user can pause the download if he desires. > > > How can I show the progress? (How can I know the amount that has > > downloaded at a given moment?) > > > Thank you. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

