1

I'm developing a native app that needs to use the Alarm API to open itself at a determined time. I saw an example in Tizen web applications, the ExercisePlanner, available with SDK samples that does this, and I want to do that too, but using my native app.

This is the code I'm using:

app_control_create(&app_control1);
app_control_set_operation(app_control1, APP_CONTROL_OPERATION_MAIN);
app_control_set_app_id (app_control1, "org.tizen.alarmsample");

struct tm date;
int alarmId = 0;

alarm_get_current_time(&date);
date.tm_mon +=1;
date.tm_year += 1900;
date.tm_min += 1;

alarm_schedule_at_date(app_control1, &date, 0, &alarmId);

According with some logs, this code creates an alarm properly but, at the passed time, my app is not called. It's ignoring it. Using the alarm_schedule_after_delay function, it works properly, since it uses only a delay to open the called app, not a date.

Is there anything wrong with the code? How may I solve this?

Regards.

matthias_h
  • 11,356
  • 9
  • 22
  • 40
Hime
  • 369
  • 3
  • 15
  • please specify which API do you use (package name / rpm + header path), preferably with version. – m.wasowski Oct 15 '14 at 10:12
  • I'm using the newest SDK version available, 2.3b. According with the documentation available at IDE I'm using the app_control_h type with the glib, app and time imports. I'm following the Alarm tutorial available at IDE Help Contents. – Hime Oct 16 '14 at 14:20

1 Answers1

0

I figured out what I was doing wrong. The code works perfectly, the problem is that I was adding 1900 years to the current year, so, at the end, my year was something like 3400, instead of 2014.

I changed this and now it works normally.

Sorry for that and thank you for the help.

Hime
  • 369
  • 3
  • 15