I want to implement push notification in android.
I have search for push notification and know that for push notification I have to use C2DM.
For use of C2DM I have to keep connection live from my device. I want to get a counter from website when a counter changed.For that I have made a service and I am starting that service in every 5 minutes interval time.
So is it proper way to start service at every 5 minutes or I have to use C2DM?
Broadcast receiver is opt for push notification .
Look at here
I was want to get counter from webservice and want to update in application when ever it changed for that I had write a service and its work to make connection to webservice and get a count.I am starting this service at every 10 or 15 minutes and after getting counter i am dismissing this service and schedule after next 10 minutes.It is working fine for me.
Related
i am working on an application where we accept auction bid we have auction
start and end time in between this time we collect bids from buyer .
after auction end i want to call an api automatically where server know that auction end and server send highest bid notification to seller
If I understand your question correctly, you want to be notified when the auction time ends so you can make a call to the server. If that's the case, you can register a broadcast receiver to receive the broadcast intent and then you can decide to use the JobScheduler or workManger to make a call to the server in the background.
here's a code lab link on broadcast receivers (https://codelabs.developers.google.com/codelabs/android-training-broadcast-receivers/index.html?index=..%2F..android-training#0)
for jobScheduler (https://codelabs.developers.google.com/codelabs/android-training-job-scheduler/index.html?index=..%2F..android-training#0)
hope this helps.
Not too experienced with mobile development, but I wanted to know if this was possible.
After the user installs the app (android or ios), the app should at least once a day "wake-up" and show a push notification to the user.
Is this possible?
If I understood you correctly, I believe that you need setup a recurring alarm using AlarmManager. You also need to setup starting alarm service on device reboot. You can write a method that does what you want so it get executed when the alarm runs e.g. show notification. The following links should help you:
Repeat Alarm Example In Android Using AlarmManager
I am making an application which will send popup messages in the notification bar of the user, these messages have them send agree to a date specified weekly depending on the day, for example every Monday of each week, as I do that in android eclipse? I need besides those messages arrive so the application is closed, now I have a database in sqlite with notifications have to do weekly. Thank You
You can setup an alarm which should fire up a IntentService who in turn will fire up the notification. In the Service you can consult DB in order to decide to set a notification or not.
All this is done not in Eclipse but using Android API.
Yes, after alarm in configured, it will act despite of application running.
I want to implement a feature in an android app, which periodically pulls information from a server even when the app is in the background / not running.
It should invoke a web service and check for updates at least 3-4 times in a day, and if available pull and show them in the notification bar. When the user clicks on the notification it should open up the app screen.
Is that feasible using pull notification technology? Are there any constraints? Can you share some tutorials that will help me implement this.
Thanks..
Sudo steps hope these helps you to go ahead.
Create One Service This service will call server and gets the
updated if available and generate the Notification.
Set Repeat Alarm using AlarmManger When application launches first
time every 8 hours that is 4 times in a day.
Create BroadCastReceiver which will called by alarm manager every 8
hours.
And From BroadcastReceive's onReceive() method start the Service for
data sync.
I pretend that you know AlarmMAnager,Service and BroadcastReceiver.
The working tutorial is Here
Thanks
i want to ask you :
How to push a notification after specific time even when the application is closed?
like after 10 minutes, the application will push notification to the user.put it is not from the server so i can not use C2DM!
any code or tutorial or link will be helpful, Thank you
Use the AlarmManager to set an alarm which is fired after 10 minutes. Then react to the alram e.g. by sending the notification. Here is more information about the AlarmManager: http://developer.android.com/reference/android/app/AlarmManager.html