Languages

Menu
Sites
Language
Use Alarm without turning on device screen and opening application

Currently, I am trying to add a feature to my app that does buzzes every quarter hour, one time at 15 minutes, twice at 30, and three times at 45.

 

I have this working properly using the alarm API, however, every time the alarm is triggered the application wakes up the device display and opens the app. I would prefer this go on in the background and not display the app when it occurs. I'm currently looking into using a service for this functionality instead, but the documentation seems sparse. I feel like I may end up having to ditch the alarm API to stop it from opening up my application and turning on the screen, but from what I'm reading it seems as though trying to do any sort of manual sleeping will cause the application to be put into the background and potentially not ran at all.

 

I figured I'd ask here, as there's not too many places that seem to have answers related to Tizen, and the freenode IRC seems dead... If I figure it out before I get a reply, I'll be sure to post it here.

Responses

5 Replies
Joshua McAdams

Okay, found out how to do it. Any alarm sent to a UI application is going to turn on the screen, so you're going to have to use a service app and set the alarm for the service from within your UI app. However, after Tizen 2.4 API, you can't use the alarm API to trigger a service application. So, build your application with 2.3.2 framework to be able to launch a service. I wish this was more clear somewhere else, but I had to dig through the source code for the tizen alarm API to see this more clearly.

 

Anyways, hopefully this helps someone else if they run into this problem in the future...

Paul L

Hello, you can use alarm api on Tizen > 2/4 and service app (I'm using it my application, compiled with Tizen 3.0 ).

Check this article:

https://developer.tizen.org/dev-guide/2.4.0/org.tizen.guides/html/native/migration_guide_n.htm

SECTION: Changes in the Alarm API for Reducing Power Consumption

Joshua McAdams

Does yours always trigger? Trying it in anything past 2.3.2 never seems to trigger it at all, even with alarm_schedule_after_delay. I have background categories set too, it just doesn't ever seem to trigger.

Joshua McAdams

Well, it looks like from debugging logs it does trigger, but it's consistently 6-7 minutes late. That's way too long for it to be reliably used... a few seconds is understandable, but minutes is really beyond usable for what I'm trying to do. I guess I'll have to either play around with background categories, or stick with 2.3.2.

Paul L

Yes, it works for me, but pariod and time is limited.

from app_alarm.h on Tizen 3.0:

@param[in] period The amount of time between subsequent alarms (in seconds). Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif, This value does not guarantee the accuracy. The actual interval is calculated by the OS. The minimum value is 600sec