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 :
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 :
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!
You can achieve this using Service, There may be various others approaches available to do this but here is the one I know...
Start downloading of data in a background service
Broadcast the information whenever data changes
Receive Broadcast data in your Tab Activity
Add footer or header to your tab widget and show progress bar
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.
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.
Related
I have developed an android app and now I am trying to implement the same one in IOS but not easy. Please Somebody help me.
Below is my implementation in android.
as you see in the picture when a push notification arrives in the foreground state,
the "POP notification on the top" is shown where ever I am in the app. It's possible because I have developed it with one activity and multiple fragments that when a notification arrives, I can control it in the activity that whatever fragment I see, I can pop the notification.
But in IOS, due to my poor skill, It's not easy...
let me show you my current IOS structure which is under the designation.
as you see it, it has one tab bar controller which has 5 menu
and each menu has a navigation controller, and each of them also has a view controller.
In this structure, can I implement the notification like the first image?
or should I change the structure?..
currently, I don't know what I should study for solving this.. please let me know.
Im wondering if there is a way in android to run tasks in the background by just using the android packages without using AsyncTask. What i imagine is a background task which is still running when the Activity is already finished or the app already got closed. I want the user to see the progress of this task in the notification tab of android (the tab you can swipe down from the top of the android screen).
I want to do this for example when i send e-mails or when i send data like images to the server. because they are quite long running tasks i dont want the user to wait for them to finish. i want them to run in the background so that the user can close the app. and i want the user to see the progress in the notification bar.
Also i would like to know if there is a way to automatically repeat such a background task when it failed because the device did not have connection to the internet.
Im looking forward to read the answers and to learn something new.
You must use service.
I think these links can help you to use it:
http://developer.android.com/training/run-background-service/index.html
http://inchoo.net/dev-talk/android-development/android-simple-service/
Download a file with Android, and showing the progress in a ProgressDialog
Example: Communication between Activity and Service using Messaging
I want to know how does notification read and unread functionality works in android. I want to know how the badges number count is set visible and invisible on read and unread message method.
When I create notification in my application then it will create successfully and add with +1 increment on badges. But after read this notification all other unread notification will also disappear. I want only the reeded message notification/count will be disappeared not for all.all other those are not open will be remain unread on badge. how could I did this.
same like as our message box functionality.
I want to know how the badges number count is set visible and
invisible on read and unread message method
No there is no any direct method to do this. but i show you one way how to achieve this. This solution only working in SAMSUNG Devices. There is no guaranty it's working on all devices.
https://github.com/eldhosembabu/mathokkil/
also another way is you can achieve this by App Widget Provider in Android. for more information go to AndroidWidgets
If you want to put it on Launcher Icon , then in android its not by default functionality given. The reason behind it is, when apk is generated, apk will not find that icon attached with it, so that is the main reason.
Alternate is, you can create widget for it. Creating widget is only solution to achieve this.
My app returns a collection of status messages which I'm currently displaying in Toast dialogs. However, the number of status messages is steadily increasing which makes Toast a less viable option.
What I want to do is create a dialog that displays messages in a ListView. However, any dialog I create is shown on top of an activity and so when I change activities the dialog is lost. How can I create a dialog that maintains its visibility across activities, like Toast does?
It seems you are looking for some kind of notification service that already exists in Android. You can solve this on different levels:
In App
for Example create a BaseActivity that always has some sort of list that contains the messages you want the user to see, and extend for the activities you want. And keep some kind of a Queue for unread messages. How you visualize this is completely up to you.
Use the systems notification and consider Updating notifications.
https://developer.android.com/guide/topics/ui/notifiers/notifications.html
I'm writing an android app just to get familiar with the OS and API. I'd like to show what my app is doing to the user in a seperate screen and not via notifications. The reason is that I'd like to show the user exactly what the app is querying and how long it took etc. I saw an example of this in the superuser app which shows what the app is doing when it is updating itself.
Is there a library to do this?
Is it as simple as just showing a text box and then populating it programatically?
I would have done it so..
Just push state changes to your UI thread and display them there.
You can do that via BroadcastReceiver, which is intended to let background services communicate with UI activities, or LocalBroadcastManager which is simpler version of the previous.
Here on StackOverflow you will find dozens of questions describing how to implement it.