1

I've been seeking how to simply get a list of all enabled alarm. So far I found two things:

String nextAlarm = Settings.System.getString(getContentResolver(),
Settings.System.NEXT_ALARM_FORMATTED);

And this project but it uses:

public static final Uri CONTENT_URI =
        Uri.parse("content://com.android.deskclock/alarm");
ContentResolver cr = getContentResolver();
Cursor c = null;
c = cr.query(
           CONTENT_URI, ALARM_QUERY_COLUMNS,
            null, null, DEFAULT_SORT_ORDER);

And as said by CommonsWare here: "This is not part of the Android SDK. It may not work on all devices. It may not work on all current Android versions. It may not work on future Android versions. It is not documented. It is not supported".

So far, the first one works but gives only one alarm when I want all of them. And the second one is just not good.

So how can I get a list of upcoming alarm ?

Thanks in advance.

Community
  • 1
  • 1
zipp
  • 1,116
  • 13
  • 27

1 Answers1

1

So how can I get a list of upcoming alarm ?

You can't, any more than you can get the "list of upcoming alarm" from the hundreds of other alarm clock apps that users use (distributed on the Market, on devices that replace com.android.deskclock, etc.).

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Well, thanks for your answer. The application I wanted to do is kind of impossible then :-(. I hope google will sort this out in a futur release. – zipp Jul 16 '11 at 22:29