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
Trusted Contributor
JohnWS
Posts: 117
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon
Accepted Solution

Anyway to bring the backlight back on after a while

I am hoping to bring the backlight on after a certain amount of time rather than always keep the screen awake - is this possible? I'm wondering if an inject of a touch event would do it or something similar?

 

Thanks 

 

J

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

Re: Anyway to bring the backlight back on after a while

There's no supported API for this, and I'm fairly sure nothing is exposed to us that allows it yet. Also fairly sure nothing as simple as faking or injecting a touch event would do it.

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.
Trusted Contributor
JohnWS
Posts: 117
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon

Re: Anyway to bring the backlight back on after a while

thanks for the clarification Peter.

 

J

Please use plain text.
Trusted Contributor
JohnWS
Posts: 117
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon

Re: Anyway to bring the backlight back on after a while

There should be a way to enable backlight or keep it on now as I have just noticed an app which keeps the backlight on even though it has been minimized. This happens whilst it records the desktop.

 

How is it done?

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

Re: Anyway to bring the backlight back on after a while

The original question was specifically about re-enabling the backlight when it's off. There's no API for that still, outside of internal ones we can't use.

If you are okay with just keeping it on, there are several APIs for that though, as I mentioned earlier, in the past they had always required that the app be fullscreen.

If you've found a third-party app that does it differently, that's great. Which one is it? Note that the only one I've heard of that records the desktop, manysmallapps' "Screen Recorder to MP4 Movie", uses at least one permission that's not generally available to third-party devs to use, so perhaps it also makes use of others, even undocumented ones, to keep the screen on. (Or maybe it's a side effect of using the use_camera_desktop permission... have you tried that yourself 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.
Trusted Contributor
JohnWS
Posts: 117
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon

Re: Anyway to bring the backlight back on after a while

Actually, I was wrong thinking the backlight stays on in that screen recorder app , I also think I found a bug in it in that it needs a restart of device if you record a video but then send the app to the background and don't touch the screen - the backlight goes out and then when i try to access the camera again (core camera app or using screenrecorder) it won't start until I restart device.

 

But..

 

I have just found in the bestcamera sample that camera_start_encode or camera_start_video should keep the backlight on, im still playing with this - I currently can't get 0 returned from start_encode.

 

Probably though all my efforts over the last few days are pointless as my phone remote app would need to be able to start_viewfinder which won't start unless the backlight is on and there is no way to enable the backlight it seems programatically. 

 

 

Please use plain text.
Trusted Contributor
JohnWS
Posts: 117
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon

Re: Anyway to bring the backlight back on after a while

I can confirm camera_start_encode does indeed keep the backlight on until you close the viewfinder.

 

Now, if only there was a way to enable the backlight - there was this ability with java sdk.

 

I tried 

 

int type = SCREEN_EVENT_MTOUCH_TOUCH;
screen_set_event_property_iv(eventz, SCREEN_PROPERTY_TYPE, &type);
int i = screen_send_event(context, eventz, getpid());

 

whenever an event occurs (just for testing) and even though screen_send_event returns 0 it didn't keep the backlight on so I doubt something like this would work but somebody on this forum has mentioned they got it to work but didn't say how.

 

I am disapointed that such a simple call to enable backlight isn't available to us.

Please use plain text.