<li><a href="#manage">Managing Alarms</a></li>
<li><a href="#launch">Launching Applications with Alarms</a></li>
<li><a href="#check">Checking for Alarm Events</a></li>
- <li><a href="#notification">Managing Alarm notifications</a></li>
+ <li><a href="#notification">Managing Alarm Notifications</a></li>
</ul>
<p class="toc-title">Related Info</p>
<ul class="toc">
<p>You can set an alarm to <a href="#launch">launch an application when triggered</a>.</p></li>
<li>Alarm events
<p>You can <a href="#check">retrieve information about the next alarm event</a>.</p> </li>
- <li>Alarm notifications management
- <p>You can manage alarm notifications which will <a href="#notification">trigger notifications at given time</a>. You can also obtain notifications, which were passed to method adding alarm notifications.</p></li>
+ <li>Alarm notification management <strong>in mobile and wearable applications only</strong>
+ <p>You can create alarm notifications, which <a href="#notification">post a notification</a> when the alarm is triggered. You can also obtain the details of the created notifications.</p></li>
</ul>
<h2 id="prerequisites">Prerequisites</h2>
</pre></li>
</ol>
-<h2 id="notification" name="notification">Managing Alarm notifications</h2>
-<p>This feature is supported in mobile and wearable applications only.</p>
-<p>You can manage alarm notifications. Alarm notification is an alarm, which after triggering will automatically post <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/notification.html#Notification">notification</a>. You can add both types of alarms: <code>AlarmAbsolute</code> (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/alarm.html#AlarmAbsolute">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/alarm.html#AlarmAbsolute">wearable</a> applications) and <code>AlarmRelative</code> (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/alarm.html#AlarmRelative">mobile</a>, <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/alarm.html#AlarmRelative">wearable</a> applications).
-Notification will be shown in the status bar on the device</p>
-In this example we will create alarm notification with alarm type <code>AlarmRelative</code> and notification type <code>StatusNotification</code>. The notification will be posted after the alarm is triggered. This alarm will also be periodic.
+<h2 id="notification" name="notification">Managing Alarm Notifications in Mobile and Wearable Applications</h2>
+<p>Alarm notification is an alarm which, when triggered, automatically posts a <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/notification.html#Notification">notification</a>. You can create alarm notifications with both <code>AlarmAbsolute</code> (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/alarm.html#AlarmAbsolute">mobile</a> and <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/alarm.html#AlarmAbsolute">wearable</a> applications) and <code>AlarmRelative</code> (in <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/alarm.html#AlarmRelative">mobile</a> and <a href="../../../../org.tizen.web.apireference/html/device_api/wearable/tizen/alarm.html#AlarmRelative">wearable</a> applications) alarm types. The notification is shown in the status bar on the device.</p>
+
+<p>To create an alarm notification with the <code>AlarmRelative</code> alarm type and <code>StatusNotification</code> notification type, where the alarm is periodic and the notification is posted after the alarm is triggered:</p>
<ol>
- <li><p>Create </code>AlarmRelative</code> object:</p>
+ <li><p>Create an <code>AlarmRelative</code> object:</p>
<pre class="prettyprint">
-/* Alarm will trigger after 3 seconds and repeat every 3 hours */
+/* Alarm triggers after 3 seconds and repeats every 3 hours */
var alarm = new tizen.AlarmRelative(3, 3 * tizen.alarm.PERIOD_HOUR);
</pre></li>
- <li><p>Create <code>ApplicationControl</code> and <code>StatusNotificationInit</code> needed for <code>StatusNotification</code>:</p>
+ <li><p>Create the <code>ApplicationControl</code> and <code>StatusNotificationInit</code> instances needed for the <code>StatusNotification</code> notification type:</p>
<pre class="prettyprint">
/* Create ApplicationControl object */
var appControl = new tizen.ApplicationControl(
null,
"image/jpg",
null);
-/* You can add additional attibutes to the dictionary */
+/* You can add additional attibutes to the notification dictionary */
var notificationDict =
{
content: "This is a simple notification's content.",
/* Create StatusNotification object */
var notification = new tizen.StatusNotification("SIMPLE", "Simple notification's title", notificationDict);
</pre></li>
- <li><p>Add alarm notification:</p>
+ <li><p>Add the alarm notification:</p>
<pre class="prettyprint">
-/* Add created alarm to the storage */
+/* Add the created alarm to the storage */
tizen.alarm.addAlarmNotification(alarm, notification);
</pre></li>
- <li><p>You can get added notification before the alarm goes off:</p>
+ <li><p>You can retrieve the details of the added notification before the alarm goes off:</p>
<pre class="prettyprint">
/* Obtain notification object */
var noti = tizen.alarm.getAlarmNotification(alarm.id);
console.log("Notification title: " + noti.title + ", content: " + noti.content);
-</pre></li>
-You can also <a href="#removeAlarm">remove alarm notification</a> with method <code>tizen.alarm.remove()</code>.
+</pre>
+<p>You can <a href="removeAlarm">remove the alarm notification</a> with the <code>tizen.alarm.remove()</code> method.</p></li>
</ol>
<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>