I want to create a notification for users to remind them to open my app, in case they haven't opened it for more than a week. How can this be accomplished if my app isn't opened?
You can use AlarmManager to schedule and run your notification code. http://developer.android.com/reference/android/app/AlarmManager.html
You can find a lot of tutorials e.g. http://code4reference.com/2012/07/tutorial-on-android-alarmmanager/
So when your app starts you should cancel previous alarm and schedule new alarm to now + one week. This way alarm will be called(and notification displayed) only if app was not opened for more than week
you can try implementing push notifcations. Here is an example from parse. Very easy. You can also do your own. Push Notification
Related
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 a new developer and don't know much about android programming. I am trying to make an app that reminds a user to do a particular thing every day at a specific time (like going to gym at 5:30 pm). I am able to get a notification after clicking of a button but i want this to be done by the app i.e. even if the app is not running it will remind me everyday to go the gym at 5:30. How can I get this???
I tried using AlarmManager but it gives my notification at that time only and sets the alarm for the specified time.
Set repeating alarm. on broadcast receiver start your notification
I am trying to make a reminder application on Android. I have taken data from the user and saved in a database. How do I trigger an alarm or push notification on user entered date?
To create push notification, you have to register on console API. but I can't post link , because of low reputation and get your own key. Personally I used this tutorial to create and handle push notification.
http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
but I can't understand why do you need it to alarm user.
To implement alarm after some elapsed time, you can create Service:
http://developer.android.com/reference/android/app/Service.html
There you can create your own alarm or use one of the standard. Sorry, I can't provide code example, because your question is too general.
Insert the information into the Calendar application with the appropriate settings and you will get an alarm when the event occurs.
I am new to notifications in Android and I want the app to display a notification once every Sunday. I am not sure how to do this when the activity is not running.
Thank you in advance!
You should start reading and understanding how alarms works: here then you can make the alarm activate the notification on given time.
NOTE: that the alarms won't get saved after reboot so you will need to add a boot complete receiver.
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