01-19-2013 01:36 PM
While my application is in Active Frame mode I have an alarm that fires based on a users setting. The user gets to set the interval on how often the cover frame screen updates.
While debugging my aplication using the DEV Alpha I noticed the Alarm keeps on firing even when the screen shuts off. In order to help reduce battery drain I would like the Cover alarm to stop firing when the screen turns off and start again when the screen is back on. Is this possible?
The alarm i set is : QNXSystem.system.setAlarm(1000*alarmTime, True);
Solved! Go to Solution.
01-19-2013 09:58 PM - edited 01-19-2013 10:00 PM
Cancel the alarm with cancelAlarm()...
01-19-2013 10:01 PM
Yea but what event indicates that the screen turned off and turned back on?
01-19-2013 10:28 PM - edited 01-19-2013 10:29 PM
IowWindowEvent.WINDOW_STATE_CHANGED lets you monitor exactly whether your app is only minimized or completely hidden, so you can cancel the system events while they are not needed (IowWindowState.THUMBNAIL, IowWindowState.HIDDEN and IowWindowState.NORMAL
My app : Get set - Get up! Get ready for the snooze revolution.
01-20-2013 12:42 AM
The very same page that documents setAlarm() and cancelAlarm() describes active, inactive and standby events...
01-20-2013 01:07 AM
apman wrote:
IowWindowEvent.WINDOW_STATE_CHANGED lets you monitor exactly whether your app is only minimized or completely hidden, so you can cancel the system events while they are not needed (IowWindowState.THUMBNAIL, IowWindowState.HIDDEN and IowWindowState.NORMAL
My app : Get set - Get up! Get ready for the snooze revolution.
Thanks that did the trick!!
Also, found the documentation all here..
https://developer.blackberry.com/air/documentation
It also notifies me when the application can't be seen.