Action: SET_ALARM

This action is used to set an alarm optionally with a repeat frequency.

Attributes Value Mandatory
action_name SET_ALARM Yes
event_list comma separated list of events, eg: TAP Yes
type audio Yes
date date and time for ex. ‘01/31/2013 9:00AM’ No
format format of date for ex. ‘MM/dd/yyyy HH:ssa’. Formats are specified using Date and Time Patterns. No
repeat hourly, daily, weekly, monthly, yearly. Default is none No
interval Specifies the time interval from the current time to set an alarm. For ex. 10sec or 10min or 10hours from now. Either the interval or data/format can be specified to set an alarm but not both. No
display_activity_class alert, dialog, screen. No
avm_screen_name Name of the screen or dialog to be shown when the alarm is invoked. Needed when display_activity_class is dialog or screen No
title Needed only when display_activity_class is alert or not defined. A dialog box is displayed with the title. No
message Needed only when display_activity_class is alert or not defined. A dialog box is displayed with the message. No

repeat

Attribute repeat is used to set the frequency of the alarm. The table below describes values of format attribute with the corresponding repeat value.

For example: repeat=”daily” format=”HH:mma”. Learn more about format -Date and Time Patterns

value format must contain following
none M, d, y, one of (H, h, K or k) and m
hourly m
daily one of (H, h, K or k) and m
weekly E, one of (H, h, K or k) and m
monthly d, F, one of (H, h, K or k) and m
yearly M, d, F, one of (H, h, K or k) and m

interval

Attribute interval specifies the time interval from the current time to set an alarm. It can be specified by having a number followed by a suffix.

For example: interval=”10sec”, interval=”10min”, interval=”10hours” from now.

Note

Either the interval or date/format can be specified to set an alarm but not both.

Interval suffix
seconds s, sec, secs, seconds
minutes m, min, minutes
hours h, hr, hrs, hour, hours
weeks w, week, weeks
months mon, month, months
years y, yr, yrs, year, years

Getting Alarm Id

Once the alarm is set, it is assigned an “_id”.

Examples

Example 1 Set an alarm for ‘Jan 1, 2014 8:00AM’ and display the message “Happy Birthday!!!”

<action event_list="TAP" action_name="SET_ALARM" type="audio" date="Jan 1, 2014 08:00AM"
    format="MM/dd/yyyy HH:mma" display_activity_class="alert" title="Hi..." message="Happy Birthday!!!"/>

Example 2

Set an alarm that repeats every day at 8:00AM and display the message “Good Morning...”

<action event_list="TAP" action_name="SET_ALARM" type="audio" date="08:00AM" format="HH:mma" repeat="daily"
    display_activity_class="alert"  title="Hi..." message="Good Morning!!!"/>

Example 3

Set an alarm that repeats every month on 1st at 8:00AM and display the message “Did you pay monthly dues?”

<action event_list="TAP" action_name="SET_ALARM" type="audio" date="01 08:00AM" format="dd HH:mma" repeat="monthly"
    display_activity_class="alert"  title="Hi..." message="Did you pay monthly dues?"/>

Example 4

Set an alarm 10 minutes from now and display the screen called “welcome”

<action event_list="TAP" action_name="SET_ALARM" type="audio" interval="10min"
    avm_screen_name="welcome" />

Good Read

CANCEL_ALARM, STOP_ALARM_MEDIA_PLAYER