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
apman
Posts: 194
Registered: ‎11-12-2010
My Device: Not Specified
Accepted Solution

BB10: qnxSystem.ALARM not firing

I'm using qnxSystem alarms and qnxSystem.runFrameCycle() to keep my alarm clock app minimally active while it's in the background, so it can check the time every 20 seconds and turn the powerMode up to throttled if the alarm sound is due to play.

It all works perfectly in my PlayBook app, and with BB10 it works perfect, but only in debug mode. When I install a release build it seems that the system alarms stop firing (or having any effect) when the window is hidden. The app is just dead in the background!

(Even when the thumbnail comes back into view, it still doesn't get any events (Active Frame not updating), but strangely, it can then be 'woken up' by slightly wriggling (scrolling up and down) the screen with the app thumbnails)

 

Any thoughts on why this is happening? Or how I can get around it?

 

Anna

 


My app : Get set - Get up!   Get ready for the snooze revolution.

Please use plain text.
Retired
dmalik
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook

Re: BB10: qnxSystem.ALARM not firing

That's strange that it works in debug mode and not in a release build. Have you tried doing a "clean" on your project? 

 

If that doesn't work are you able to provide a sample at all? 

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Please use plain text.
Developer
apman
Posts: 194
Registered: ‎11-12-2010
My Device: Not Specified

Re: BB10: qnxSystem.ALARM not firing

I've cleaned loads of times in the last couple of days as I moved to the Gold SDK, FB 4.7 and the latest build for the Dev Alpha - I was hoping that the problem might go away with all the new stuff ... :-)

 

I'll see if I can isolate the problem in a small sample ...

 

 


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

Re: BB10: qnxSystem.ALARM not firing

Do you have:

 

 <permission>run_when_backgrounded</permission>

 http://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.native_sdk.devguide/com.qnx.do...

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
apman
Posts: 194
Registered: ‎11-12-2010
My Device: Not Specified

Re: BB10: qnxSystem.ALARM not firing

Thanks Innovatology, I just tried that, but I'm getting a packaging error

 

[ERROR] MANIFEST.MF: Invalid value'access_shared,access_internet,play_audio,set_audio_volume, run_when_backgrounded ' for attribute 'Entry-Point-User-Actions'.

 

Are you sure it's not just for native?

 


My app : Get set - Get up!   Get ready for the snooze revolution.

Please use plain text.
Retired
dmalik
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook

Re: BB10: qnxSystem.ALARM not firing

It is in the AIR docs. https://developer.blackberry.com/air/documentation/bb10/accessing_secure_apis_1524628_11.html 

 

It does come with a warning though: "Use this feature sparingly and only when your application must perform processing in the background."

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Please use plain text.
Retired
dmalik
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook

Re: BB10: qnxSystem.ALARM not firing

There also appears to be a new section (new to me anyway) on managing application states - https://developer.blackberry.com/air/documentation/bb10/managing_application_states.html 

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
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

Re: BB10: qnxSystem.ALARM not firing

AIR alredy had its own mechanism for this, albeit in slightly less detail... See "Application Lifecycle" here:

http://help.adobe.com/en_US/air/build/WSfffb011ac560372f82c4ee412b1275403b-8000.html#WS901d38e593cd1...

 

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
apman
Posts: 194
Registered: ‎11-12-2010
My Device: Not Specified

Re: BB10: qnxSystem.ALARM not firing

[ Edited ]

Yea, thank you both for your help!!!  The permission setting does the trick! (no idea why the packager complained about it the first time, I just tried again and now it works!

:Clap:

 

(And don't worry, Dustin, I have every intention to 'use it sparingly' - but I think an alarm clock forgetting the time as soon as the screen dims is a bit of a ship stopper, right ? :-)

 

Thanks again - you really made my day!

Anna

 


My app : Get set - Get up!   Get ready for the snooze revolution.

 

 

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: BB10: qnxSystem.ALARM not firing

RIM: It would be helpful that when things like permission settings change, that there is some kind of announcement. I would have not know about that ever if this thread was not here.
Please use plain text.