语言

Menu
Sites
Language
How to create an alarm app

I am trying to run the alarm sample native app. The app launches without any errors, however the screen only shows "Recurring Alarm" and "On-time Alarm" text and nothing else. The app doesnot respond. Please help!

查看选择的答案

响应

2 回复
Mark as answer
Mehedi Alamgir

Hi Ashfaq

Actually Sample Alarm app is service based app. A time is set in the code, after that defined time alarm will fired automatically.

To check the alarm time in Sample app, go to

src --> data.c--> _initialize_ontime_alarm(void)

At the bottom of this function there is a variable named "t_alarm". In this variable alarm time is calculated. Here the value of three macros (ALARM_DELAY, ALARMS_INTERVAL, RECURRING_ALARMS_TO_BE_INVOKED) is defined at the top of the code, right after the structure declaration. Values of these macro are in SECONDS mode.

In sample app the value of the macros are big enough, that's why you can't  understand when the alarm is occured . So initialized that three macros with small value. For Example 

#define RECURRING_ALARMS_TO_BE_INVOKED 1 
#define ALARM_DELAY 1
#define ALARMS_INTERVAL 1.

Now run the sample app, you will see the alarm.

Hope this will help you.
If you find my answer is helpful for you, Please mark it as BEST ANSWER so that other may find it easier from the next time.

 

Kazi Al Ashfaq

Hello Mr.Alamgir,

Thank you for your answer. I find it helpful. I am able to implement the alarm app service.