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.
Related
I would like to ask some questions and getting your advise regarding to reminder notification, I have no experience in coding Java and this is my first trying develop Android app. My apologize for if my questions are duplicated.
The brief of what I need is : In my app, I have a setting for user to set Reminder and they can choose what time(from ListPreference) to keep remind them daily.
So my question is which one should I use
AlarmManager - as same as this Implement Notification Reminder? But I have a doubt on this, if the apps is not running(not opened) will the reminder still sending?
Firebase Cloud Messaging - If use FCM, how do I schedule and trigger to send push notification for reminder at specific timing to specific user?
Any Other simple method?
I have tried this method--> Write a function with nodejs to check the data change in Firebase to send notification to the app; deployed nodejs to Firebase Function. But the thing is i don't know how to schedule a job to keep changing data in firebase, it works when i manual keyin data. I think this is not the correct way, should not talking to database just to implement a simple daily reminder. Also this is not recommend method, right?
Hope I will get simplest advise from you all. Thanks
You could use the AlarmManager to set daily reminder but its not highly accurate after API Level 19(Kitkat)
And yes it will work when you app stops no issue but if your phone restarts you need to use the broadcast receiver which trigger when phone reboot and set the alarm again.
Or you could use this library Evernote android job which is very efficient when it comes to Scheduling and reminders.
I am using it in my app which have schedules on daily and weekly basis and its working perfectly.
I have to implement a reminder - make the note, then store it in local DB and then make the notification when time comes. I have no experience in mobile development so I'm asking what's better - to implement some time manager that will invoke notifications instantly or store the notifications "as is" to let them be activated by themselves.
What is good approach?
EDIT: I forgot to mention, that I use Xamarin and I've already implemented cross-platform notifications, but now the problem is to choose right way to store and handle them
Use AlarmManager, record your title, message or details of reminder in Database. When alarm is triggered, query your Database to get Title and Message of your notification and show it.
Links:
Services (AlarmManager)
Notification
Im developing an app with a feature by which people can set reminders for themselves for various events (like take medicine with dosage amount). The user should be able to
1) Set a time for the reminder
2) Set a date for the reminder and choose between recurring/ non-recurring
3) When the alarm gets triggered, a notification should be built for the user
4) Alarm should have a snooze option as well
I know how to use notification builder to add a notification with a pending intent and have read documentation on Alarm Manager but Im still completely lost with this task. Could someone please give me some guidance or help?
It seems that the following will supply sufficient documentation on interfacing with alarms in the android SDK.
https://developer.android.com/training/scheduling/alarms.html
I'm using my application GCM push notification. I can send a message to the user via php. But I want to make a push notification can operate on its own. So in practice the day if not used, the application was not used today because you get a push message. If you send me the following hours or user himself he put option is sending messages to alert the user that hour. How do I do this?
Edited:
is can be local notification ? maybe i wrote wrong ? :)
i added this project in my app.but i need more :)
I would get the application to store the last used time somewhere, such as a database table.
Then create a PendingIntent and BroadcastReceiver to fire at the desired time. The broadcast receiver checks the last used time, and creates a standard Notification if the app was not used for that day.
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.