How to use Android Built-in Alarm to integrate my alarm app? - android

I want to create my alarm app.
but, I don't want to re-design a new alarm clock function.
so, I want to use android built-in alarm clock.
what I want the procedure is:
use android built-in alarm clock to set the time.
when the alarm is ring, my alarm app will be launched to replace built-in one.
use my alarm app to dismiss the alarm.
How could I make it?
Thank you so much.

How could I make it?
You can't. The only thing an SDK app can do with respect to the device's own alarm clock app is to display an activity to allow the user to set the alarm, with a filled-in set of values.

Related

How to create alarms on a flutter application for Android and iOS?

I'm trying to make an app where my user would be able set multiple countdown timers and be alerted when they are finished.
It needs to keep running and be precise even if the app is closed.
It needs to ring (default alarm sound) and vibrate. Only vibrate if sound is off. But do both if the device is on Do Not Disturb mode (after all he set the alarms himself).
It needs to show a the alarm name and have a button to dismiss/turn it off even if screen is off or if he is using other apps.
Previously I was using a BroadcastReceiver to open an activity that would do all that, but it doesn't seem to be working with flutter using a channel and native code on Android.
And according to this I should use high priority notifications instead.
And I'm also kinda new to Flutter, so I've been trying with channels, pendingintents, broadcastreceivers and a second native activity to show the alarm message with a dismiss button. It's not working. It shows the native activity only if the flutter app is on foreground.
I see there are a few plugins like intents, Alarm_manager and local notifications for flutter that should do it but I can't find a way to fulfill all my needs with them.
So I'm asking the pros: what's the best way to achieve this?
For Android, you can use android_alarm_manager_plus package. On iOS however, there's no equivalent feature of Android's AlarmManager as it recommends to create a calendar event or reminder for an alarm. As a workaround, you can use flutter_local_notifications for scheduled notifications.

Setting up an Alarm system on android

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

Access the device clock alarm settings?

My app needs to wake the user up in the night so I would like to access the device's clock alarm and add my own in there. The alarm times shifts throughout the month, so I would need to access it and update it.
For example, I would like to add a daily alarm in the device clock alarm. Then everyday, I would like to run some calculation and adjust the time for the daily alarm.
Is this possible? I found AlarmManager but this seems like a scheduler not the device clock alarm. Perhaps there is an intent for the clock alarm? The screenshot below is the setting I am trying to access from my app (without rooting the device).
Here you have a tutorial about programming alarms for Android.
https://developer.android.com/training/scheduling/alarms.html
The thing is that is not needed to access the native clock app to set them, you can do it with your own app.
Be aware that this will not program an "Alarm"(with music and so on), it will only provide you the possibility to shcedule some task. In your case this task could be wake up the user with a loud music or whatever.

Android: Calendar integration with custom notifications

I need to integrate, in my android application, a calendar from which i can set new event.
I know that is possible call the android calendar (using intent), but what I need is slightly different, for this reason:
I need that when the time of the event is reached, some code is started, and no default notification occurs! In other words I want create a custom notification when alarm of event goes off. Maybe I need to use AlarmManager
How can I solve this problem?
If your problem is that you need to launch some kind of intent at a specified time then you can use AlarmManager. It allows you to schedule your application to be run at some point. When an alarm goes off, the Intent that had been registered for it is broadcast by the system.
For More information about AlarmManager, you can check this link : AlarmManager

Alarm clock like services

I want to develop an alarm clock like services in android that is the app should run on the some user entered time and even if the mobile is switched of that app should work as alarm clock works .
Use an AlarmManager. See this SO question. You'll also probably want to recreate your alarms on reboot (they're normally cleared then); see this android developers thread.

Categories

Resources