I have asked this question before (here), however it received no attention and I feel like this could really prove as useful to those who chose to embark on a similar issue.
Basically, I am implementing an application that sets alarms for the user, and in my current attempt I am using the ACTION_SET_ALARM intent to set the system alarm. Now this works fine with one exception: whenever I set an alarm, it makes a brand new alarm until eventually the alarm database is utterly filled with redundant alarms.
I’m trying to figure out how to set UNIQUE alarms without having to completely design my own alarm clock application. There must be a way to do this, simply by utilizing some feature of the native Android alarmclock class.
Methods I have employed thus far:
-
Android developer documents;
-
Pretty much every forum post on SO about this topic;
-
Utilizing various other intents i found by searching through the deskclock source code;
-
Importing the Alarms class, the setAlarm class.
The last remaining option for me is to embark on the AlarmManager class, but this is essentially recreating the alarmclock class and I want this application be generic (it can apply to most alarm clock applications) and not have to rely on its own.
Any assistance would be very appreciated.
You are welcome to your opinion, though your opinion may need to be accompanied by your own fork of Android and your own line of mobile devices.
First, there isn’t really much of a “native Android alarmclock class”. It is mostly just an
Intentaction string and a series of keys for extras. The implementation of the alarm clock functionality is device- and user-dependent, though many will simply use one from the Android open source project.At this point, you run into two problems:
The app from the Android open source project does not support what you want
No other app has to support what you want, as it is outside the scope of documented behavior