Having just purchased a Nexus 7 Tablet (and being new to the Android user experience), I love the assortment of Widgets that come with the software, but I’m surprised there’s no widget to list any alarms you have set through the Clock app. I’m making good use of the “Remind me to” command with Google Voice Commands to set reminders, so it’d be nice to see a list of alarms set through the Clock app.
To that end, I’m setting out to create an Android Widget that displays the list of alarms in the Clock app, complete with title and date/time. I’ve read that using a ContentProvider to achieve this isn’t compatible on many devices and isn’t supported, so I’d like to find a better solution if possible.
Can anyone help me discover how to retrieve the list of alarms in the Clock app? Naturally as soon as it’s done I’ll be happy to share it on Google Play. Thank you!
The “better solution” is to either find an existing third-party alarm clock that has the app widget you desire, or to write your own alarm clock app that, among other things, has the app widget you desire.
The only documented and semi-supported API for Android related to the alarm clock is for you to define a new alarm. There is no documented and supported means for you to access or manipulate the alarms in the alarm clock app, and on Android 4.2 (which is presumably what your Nexus 7 runs), the undocumented-and-unsupported
ContentProvidershould be unavailable, as it is not exported.You could contribute patches to the existing AOSP Alarm Clock app, to add the app widget or add the
ContentProviderto the SDK (and actually mark it as exported). But it will take a long time for those patches to become available in a production Android release, assuming that they are accepted.