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
smiley
Posts: 1,468
Registered: ‎07-14-2008
My Device: Z10
Accepted Solution

How to make the background app to be visible?

So I have an application running in the background.  When it is not visible eg: minimized in active frame mode how do I programmatically maximize it or make it visible?  Is this possible?

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

Re: How to make the background app to be visible?

There's no way to do this. Are you sure you'd even want to? Generally that would bother a user, who may be in the middle of something else and not want to be interrupted.

If you have something to tell the user, that's what the notification system is for. Make an audible alarm, turn on the LED, make an entry show up in the Hub, let the user decide whether or not to interrupt his current task and peek at the Hub to see if it's something he cares to deal with at the moment. Popping up right in his face is something that (for most situations) went out with Windows 98 or so... :-)

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
smiley
Posts: 1,468
Registered: ‎07-14-2008
My Device: Z10

Re: How to make the background app to be visible?

Yeah. I need to make the app visible to get their attention.  I guess making an alarm is the next best thing then.  thanks

Please use plain text.
Contributor
SammyBGoode
Posts: 22
Registered: ‎11-12-2012
My Device: Bold 9900

Re: How to make the background app to be visible?

 

>> There's no way to do this. Are you sure you'd even want to? Generally that would bother a user, who may be in the middle of something else and not want to be interrupted.

 

Really?  No way at all?  I agree that if the user is in the middle of something else you don't want to bother him/her with an in-your-face app maximization, but suppose the device is asleep -- ie user doing nothing -- and event occurs that requires handling using resources only available when the device is not asleep?  This is not possible?  Really?  No workarounds at all? 

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

Re: How to make the background app to be visible?

An app need not be fullscreen for it to receive CPU and do processing. The ability to have an app do stuff while the device is "asleep" (note that it never really sleeps) is unrelated to whether the app is visible or not.

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.
Contributor
SammyBGoode
Posts: 22
Registered: ‎11-12-2012
My Device: Bold 9900

Re: How to make the background app to be visible?

>> The ability to have an app do stuff while the device is "asleep" (note that it never really sleeps) is unrelated to whether the app is visible or not.

 

Thanks.  Yes, I appreciate that code can run while app is in background.  But when an app is sent to background, certain resources are turned off.   I am playing around now to see if I can "turn on" these resources while the app remains in the background.  I'd certainly prefer it this way.  Stay tuned!  SbG.

Please use plain text.
Contributor
SammyBGoode
Posts: 22
Registered: ‎11-12-2012
My Device: Bold 9900

Re: How to make the background app to be visible?

>> I am playing around now to see if I can "turn on" these resources while the app remains in the background.  I'd certainly prefer it this way.  Stay tuned!

 

Ok, just confirmed.  One cannot turn on the camera while the app has been backgrounded.  I get a return value from camera_open of 16.  Therefore -- apparently -- if I want to use any camera calls while in the background, I must find a way to take it out of the background.  Any ideas, anyone?  SbG.

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

Re: How to make the background app to be visible?

So even with run_when_backgrounded permission defined, you can't open the camera? Interesting... Have you checked if the camera has a "background" flag available as some of the other sensors do? (I haven't yet...)

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.
Contributor
SammyBGoode
Posts: 22
Registered: ‎11-12-2012
My Device: Bold 9900

Re: How to make the background app to be visible?

>> So even with run_when_backgrounded permission defined, you can't open the camera?

 

Thanks.  I  haven't checked if there is a camera specific flag one must flip.  But will do so now.  The app flag has been set for background, obviously.  SbG.

Please use plain text.
Contributor
SammyBGoode
Posts: 22
Registered: ‎11-12-2012
My Device: Bold 9900

Re: How to make the background app to be visible?

I see no flag to run the camera in the back ground.  You say other sensors have flags, but the camera is not a sensor, at least as formally defined. 

 

Are you guys sure one can't somehow,/anyhow programmatically wake the app up?  I am referring to sending the equivalent a SW_MAXIMIZE msg under Windows.   Frustrating.  No way to spoof the thing?   I don't even need the camera.  I just need the camera light.  But the camera light won't work w/o a valid camera_handle and I can't get a valid camera handle while in the background.  Arrrghhhhh!!!!  Thanking you all in advance.  SbG.

Please use plain text.