Question

I want to achieve something in my application, but I'm not really sure which is the best option to do that. In my app I am downloading data via web server. I want to create something like global Progress Bar which must show the user how much data he is downloading from the whole application..no matter on which activity he is. I think it's the right time to say that I am using TabHost and TabGroupActivity in my application. So for now this is how I think it should look like :

enter image description here

For a second option I was thinking if it will be a better option to implement a notification with progress bar which is updating the downloaded data size..something similar to Google Play store notifications while downloading application :

enter image description here

Any suggestions what I should look for and which is the best way to do that in Android Application?

Thanks for any kind of information!

Was it helpful?

Solution 3

My first decision was to create a custom view, which had title, some custom action buttons and textviews which I added to every screen. After that I changed to ActionBarSherlock and made some custom design for it too so it can look like the same in every version and that worked for me.

OTHER TIPS

You can achieve this using Service, There may be various others approaches available to do this but here is the one I know...

  1. Start downloading of data in a background service
  2. Broadcast the information whenever data changes
  3. Receive Broadcast data in your Tab Activity
  4. Add footer or header to your tab widget and show progress bar
  5. Keep updating the data in progress bar til your download finished

Also you can update notification from Service whenever data updates.

If you want to use the "Progress Bar In Activity" option, you are, in some way, forcing the user to open your app to check the progress while I think is much better a permanent notification taken in account by your download service.After all this is the main meaning of the Android notification Bar. In this way the user, in every moment, can easily check the progress by dropping down the menu.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top