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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 133
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
Developer
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
Highlighted
Developer
Posts: 133
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
Developer
Posts: 194
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.

Developer
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
Developer
Posts: 133
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