Languages

Menu
Sites
Language
Alarm not working in Emulator

I tried to add alarm using Alarm API and when I tried to run the app using Emulator the alarm is not triggered on the given time. Please let me know if the Emulator support alarm API?

Given below the basic code I used.

var appId = tizen.application.getAppContext().appId;
var alarm = new tizen.AlarmAbsolute(new Date(2013, 4, 24, 10, 30)); // Time set for April 24th, 2013, 10.30AM
tizen.alarm.add(alarm, appId);  // Setting the alarm

I added the following privileges in the config file:

 

<tizen:privilege name="http://tizen.org/privilege/alarm" />
<tizen:privilege name="http://tizen.org/privilege/application" />
Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

4 Replies
Lakshmi Grandhi
Hi Anfas, if you want add alaram for April your month should be 3 not 4 , it takes values from 0-11, kindly check alram will be created for May with your code Thanks Lakshmi
Lakshmi Grandhi
i have tested the below code it is working var date = new Date(2013, 0, 1, 8, 0); var alarm = new tizen.AlarmAbsolute(date, ["SA&", "SU"]); tizen.alarm.add(alarm, "org.tizen.clock");
anfas ci
I tried with month no. 3 also but still its not working. After setting the alarm using above code, I'm able to get the alarm Id. But when I tried to get the count of alarms, I got 0 count. Following is the code I used for getting the count. var alarmsArray = tizen.alarm.getAll(); console.log("No of Alarms : "+alarmsArray.length);
anfas ci
Finally I found that the issue was with the SDK. I was using SDK Version 2.1.0 and now I installed 2.0.0. Now the alarm is working perfectly in the Emulator.