[android-developers] ACTION_SET_ALARM Intent seems too simple

2012-07-19 Thread Marc McDougall
 

I am attempting to write an application that automatically sets the Android 
default alarm based on some preset values determined by an alternate 
algorithm.

The alarm setting works fine using the ACTION_SET_ALARM intent, however 
every time I run the app, it sets a NEW alarm. I'm wondering if there is 
any way to instead have one unique alarm set to update every time the 
activity sets the alarm (so that there are not hundreds of new alarms in 
the Android alarm application).

I will provide code excerpts if necessary, however it seems that this 
question can be answered without specific examples. NOTE: I am not using 
the Android alarm system that is intended for informing other activities of 
certain events, but rather the actual Android alarm that users will utilize 
to wake up in the morning.

Here is a code snippet that explains what I am doing:

Intent intent = new Intent(AlarmClock.ACTION_SET_ALARM);
intent.putExtra(AlarmClock.EXTRA_HOUR, time.getCurrentHour());
intent.putExtra(AlarmClock.EXTRA_MINUTES, time.getCurrentMinute());
intent.putExtra(AlarmClock.EXTRA_SKIP_UI, true);
startActivity(intent);

Thank you in advance for any assistance!

Some further attempts:

I have tried to bundle the intent Intent.ACTION_EDIT with my intent and 
tried to specify the alarm local to the device, but I can't seem to find 
any documentation on how one would do this. Nor do I know that this is the 
way to complete my goal.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] ACTION_SET_ALARM Intent seems too simple

2012-07-19 Thread Mark Murphy
On Wed, Jul 18, 2012 at 10:13 PM, Marc McDougall
marcjmcdoug...@gmail.com wrote:
 I'm wondering if there is any
 way to instead have one unique alarm set to update every time the activity
 sets the alarm (so that there are not hundreds of new alarms in the Android
 alarm application).

This does not add an alarm to the Android alarm application. It adds
an alarm to whatever alarm clock application the user chooses, based
on what activities respond to ACTION_SET_ALARM.

Beyond that, there are no documented extras for this, and therefore
you cannot assume that any given alarm clock implementation will
support replacing an existing alarm.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in DC: http://marakana.com/training/android/

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en