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
Contributor
Posts: 21
Registered: ‎03-21-2011
My Device: BlackBerry Z10
My Carrier: Telus

Alarm not firing when app is Hidden

I have a normal Timer object being used to check the current time and start playing audio if the time matches the set value.  This works fine but doesn't fire once you minimize the app.  So I tried setting the application inactiveStandbyMode to both Normal and Throttle (at different times, of course) but neither one allowed for it to work when minimized.

 

So steering away from that, I decided to throw in an alarm using the setAlarm function and listening for the event to fire off the checking to start playing.  This is behaving the same way that it's not working when the app is Hidden.  It works when minimized but not when it's hidden.

 

The annoying part is that when I'm debugging, it works fantastic no matter what state it's in (as it should).  As soon as I sign the BAR and push it to the device, Hidden locks things down.

 

Does anyone know a way around this?  Sounds like it may be a bug?

 

Thanks in advance!

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Alarm not firing when app is Hidden

Contributor
Posts: 21
Registered: ‎03-21-2011
My Device: BlackBerry Z10
My Carrier: Telus

Re: Alarm not firing when app is Hidden

Unfortunately I've tried with and without; neither allowing it to kick in when hidden.


jtegen wrote:
Are you setting the throttle in the API?
http://developer.blackberry.com/air/apis/bb10/qnx/system/QNXSystemPowerMode.html

 

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Alarm not firing when app is Hidden

How about trying setTimeout. Does that get called?
Contributor
Posts: 21
Registered: ‎03-21-2011
My Device: BlackBerry Z10
My Carrier: Telus

Re: Alarm not firing when app is Hidden

I haven't tried that one.  I will give that a go and see what happens.  Thanks for the input!

 


jtegen wrote:
How about trying setTimeout. Does that get called?



Developer
Developer
Posts: 227
Registered: ‎01-17-2012
My Device: PB
My Carrier: ATT

Re: Alarm not firing when app is Hidden

on DevAlpha, 10.9.10.35:

 

Release build, standby/minimized/hidden - this works:

	zipMonitor = QNXSystem.system.setAlarm( 1000, true );
						
	QNXSystem.system.addEventListener( QNXSystemEvent.ALARM, checkZip );

 In my bar-descriptor, I also have:

 

   <permission>run_when_backgrounded</permission>

 

Regards,

Highlighted
Contributor
Posts: 21
Registered: ‎03-21-2011
My Device: BlackBerry Z10
My Carrier: Telus

Re: Alarm not firing when app is Hidden

If I could kiss you I would!  That worked!!!  Thank you so much Smiley LOL


mdd wrote:

on DevAlpha, 10.9.10.35:

 

Release build, standby/minimized/hidden - this works:

	zipMonitor = QNXSystem.system.setAlarm( 1000, true );
						
	QNXSystem.system.addEventListener( QNXSystemEvent.ALARM, checkZip );

 In my bar-descriptor, I also have:

 

   <permission>run_when_backgrounded</permission>

 

Regards,