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

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

Sammy, you know about the Keep-Awake feature though? It doesn't help bring a thumbnailed app back to fullscreen, but it does let a fullscreen app keep the system from going into standby and thereby prevent itself from ever being backgrounded.

As for am I sure? Not 100%... maybe you can manage to invoke your own app in some fashion that pops it to the foreground, but if they manage to allow that I'd strongly expect them to treat it as a bug and fix it. No app should be able to grab the foreground like that. The missing feature in your case isn't that you can't get to the foreground, clearly, but just that the camera appears not to support being used from a background app for now. File a feature request in Jira?

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!
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

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

hmm.. your app should still be able to use the camera while it is not in the foreground.We specifically have at least one background service which uses the camera, so I know there is nothing technically preventing it on the camera side.

 

BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

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

unless of course the screen is asleep.  when the screen is shut down, the camera hardware powers off.

Contributor
SammyBGoode
Posts: 22
Registered: ‎11-12-2012
My Device: Bold 9900

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

>> our app should still be able to use the camera while it is not in the foreground.

 

This is an embarassing brain fart on my part.   I mentally swapped background processing with processing when the screen shuts down.  (That said, one must configure sensors to "run in background" in order for them to work when the screen shuts down.  Hence the conflation?)  I have not confirmed camera accessibvility while minimized but I take your word for it. 

 

Thank you and apologies for the afrorementioned brain fart.

 

Alright, my next issue is then to get the screen lock freed programmatically.  I have not looked into this.  If anyone wants to save me some trouble as opposed to, say, enjoying their New Years Eve....   Ha ha. 

 

Thanks for all your help here this aft.    Much appreciated.  Happy New Years to you all.  2013 gonna be rippah for this community.  -SbG.

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

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

SammyBGoode, you're back to square one then, since there's currently no API for bringing the device out of standby, aka waking it up, aka turning the screen back on.

You can, at least, use the Keep Awake stuff to prevent the screen from shutting off in the first place, provided your app stays fullscreen (which implies not backgrounded). You do that through Application.mainWindow's screenIdleMode setting: https://developer.blackberry.com/cascades/reference/bb__cascades__window.html#screenidlemode

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

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

Peter,

 

Nah, the "keep awake" functionality won't help me.  The use case depends on the device being "dormant", which is to say, app-in-background, screen off.  That is the starting premise.

 

Maybe I can kludge something via notifications.  Cheers & thanks again -SbG.

BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

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

good luck... in the future we are looking to decouple camera powerdown from screen powerdown, in which case this may be more feasible.  this would impact battery life of course :smileyhappy:

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

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

Sammy, if you really care about this use case, file a Feature Request ticket in Jira.

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

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

>> good luck... in the future we are looking to decouple camera powerdown from screen powerdown, in which case this may be more feasible.  this would impact battery life of course

 

Well, I tried to do what I wanted to do and it seems I am out of luck.  The Plan B was to use a notification dialog instead of the camera light.  I got this working, but even a notification dlg won't turn the screen back on. 

 

In the docs we see that "You can use a NotificationDialog to display a dialog box when an urgent event occurs."  An "urgent message."  From an U/I slash design perspective, isn't "urgent" sufficiently important to pay the battery man and spark up the screen?  

 

I can't imagine there isn't this capability inherent to the system and available to in-house developers.  I guess it is time to head over to the feature request desk and fill out the paperwork.

 

Thanks again, guys SbG.

 

 

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

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

If my device is inside my bag, in standby, and an "urgent" notification comes in, I don't necessarily want it to turn on the screen. Make the LED flash, make a sound, fine... why turn on the screen when I'm not even there?

If it's locked, turning on the screen would either show nothing useful (if my privacy is being protected), or details of the important event (which obviously I wouldn't want, without entering the password first).

So basically you'd be having the system turn the screen on for some period of time, wasting power to show possibly nobody anything. I doubt that's desirable.

Also, I'm not sure merely having the screen on would help, since if the device is still locked, I'd sort of think you'd want it still largely in standby (apps not active) until the password was entered.

There is the night mode alarm feature, apparently, which probably does turn the screen back on, so I suppose there's at least that use case. We'll certainly find out more on January 30...

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!