Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
agaripian
Posts: 131
Registered: ‎12-02-2010
My Device: Z10 & Dev Alpha C
My Carrier: T
Accepted Solution

Cover (Active Frame) Alarm Firing When Screen off

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);

 

 

---------------------------------------------------------------------
Developer of Stocks for Blackberry 10
Please use plain text.
Developer
Innovatology
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: Cover (Active Frame) Alarm Firing When Screen off

[ Edited ]

Cancel the alarm with cancelAlarm()...

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Please use plain text.
Developer
agaripian
Posts: 131
Registered: ‎12-02-2010
My Device: Z10 & Dev Alpha C
My Carrier: T

Re: Cover (Active Frame) Alarm Firing When Screen off

Yea but what event indicates that the screen turned off and turned back on?

---------------------------------------------------------------------
Developer of Stocks for Blackberry 10
Please use plain text.
Developer
apman
Posts: 193
Registered: ‎11-12-2010
My Device: Not Specified

Re: Cover (Active Frame) Alarm Firing When Screen off

[ Edited ]

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.

Please use plain text.
Developer
Innovatology
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: Cover (Active Frame) Alarm Firing When Screen off

The very same page that documents setAlarm() and cancelAlarm() describes active, inactive and standby events...

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Please use plain text.
Developer
agaripian
Posts: 131
Registered: ‎12-02-2010
My Device: Z10 & Dev Alpha C
My Carrier: T

Re: Cover (Active Frame) Alarm Firing When Screen off


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/bb10/respond_change_application_state.html

 

It also notifies me when the application can't be seen. 

---------------------------------------------------------------------
Developer of Stocks for Blackberry 10
Please use plain text.