If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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

Native Development

Reply
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Running app while in standby mode

Thanks for confirming that Sean. So the "natural" condition of a native app would be to continue processing events, though few if any events would be coming in from the OS by default. If you had a "frame timer" or something, however, you'd be wastefully continuing to receive those events and perhaps even doing work based on them, even though you're not visible and shouldn't be wasting power in such cases.

I think this explains why some of the initial native games, perhaps all those based on Marmalade, use more than 0.5W in standby... they don't listen for the "inactive" events and pause themselves voluntarily.

By the way Sean, there are numerous very valuable use cases for having apps maintain access to certain sensors and/or system features (e.g. networking) even in standby. When appropriate the user can be given the option to control this with a setting, but it shouldn't be virtually prevented by the OS. It would be nice to see some of the relevant APIs documented for this, the way the QNXSystemResource stuff is documented for AIR: https://bdsc.webapps.blackberry.com/air/apis/qnx/system/QNXSystemResource.html

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
rmisk
Posts: 64
Registered: ‎02-21-2012
My Device: Blackberry Playbook
My Carrier: None

Re: Running app while in standby mode

Hi Sean,

 

I am using bbutil and this worked perfectly.

 

Thanks,

  Roger

Please use plain text.
Developer
rmisk
Posts: 64
Registered: ‎02-21-2012
My Device: Blackberry Playbook
My Carrier: None

Re: Running app while in standby mode

Hi Sean,

 

I think I asked this in another post but I don't know what message is sent or how to capture that the tablet is about to go into standby so that I can ensure my app goes gracefully into standy, i.e. I would like to turn off  the LED or set it before going into standby.

 

Roger

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Running app while in standby mode

rmisk, here's the thread you asked that in (for reference for others): http://supportforums.blackberry.com/t5/Native-SDK-for-BlackBerry-Tablet/Message-s-Associated-With-Sw...

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
rmisk
Posts: 64
Registered: ‎02-21-2012
My Device: Blackberry Playbook
My Carrier: None

Re: Running app while in standby mode

My apologies, I should have done that.

 

Thanks Peter

 

Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 665
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Running app while in standby mode

[ Edited ]

rmisk wrote:

Hi Sean,

 

I think I asked this in another post but I don't know what message is sent or how to capture that the tablet is about to go into standby so that I can ensure my app goes gracefully into standy, i.e. I would like to turn off  the LED or set it before going into standby.

 

Roger


Roger,
I asked around and the answer I got was that in standby, regular apps are told they are invisible and inactive.

Unfortunately this state is ambiguous, and would look the same as if the app was off-screen and inactive.

 

Cheers,

Sean

Please use plain text.
Developer
rmisk
Posts: 64
Registered: ‎02-21-2012
My Device: Blackberry Playbook
My Carrier: None

Re: Running app while in standby mode

Thanks Sean, so there is no way for the developer to put an Application into Idle before the tablet switches to Standy.

 

Roger

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Running app while in standby mode

Sean, that would be a great answer were it not for the fact that AIR apps are not limited to that, as the documented API for qnx.system shows. We can not only resort to the QNXSystemPowerMode stuff to specify an inactivePowerMode of THROTTLED or even NORMAL, but we can also listen for an event that specifically says "standby" and not merely "inactive". (At least, that event is documented as existing, though I haven't tested it myself. The inactivePowerMode stuff does work though, and I use it in both my apps.)

It's definitely true that an app's window state becomes "hidden" in standby. If I and the API docs are wrong about that event, then I guess we would never hear "standby" for that event and would only ever see "active" or "inactive". Easy enough to test... but are the people you asked aware of that event and can say that it will not work, even though it's documented?

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 665
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Running app while in standby mode

[ Edited ]

The people I spoke to were the owners of power manager and navigator respecively.  Power manager maintains the required information, but not in a way that is exposed via the NDK.  The design plan was that the appropriate services would translate this low-level information and present it to the user.  The navigator is supposed to be the gateway for such state, but it sounds like there is room for additional notifications there. 

It is possible (even likely) that the AIR player has the necessary hooks into power manager which ARE aware of this state information, but AIR is outside of the scope of this forum.

 

Cheers,

Sean

Please use plain text.