Page 1 of 2

Screen brightness access on device

Posted: Mon Sep 16, 2013 3:27 pm
by osiris1@yahoo.com

Is there a way to adjust the screen brightness from javascript for an IOS device using the slider control? Firstly, can I even have access to the system brightness?


Screen brightness access on device

Posted: Mon Sep 16, 2013 3:35 pm
by maxkatz

Check if PhoneGap provides such API.


Screen brightness access on device

Posted: Mon Sep 16, 2013 3:52 pm
by osiris1@yahoo.com

Thanks. I will get it out.

I'm still a newbie when i comes to mobile coding but a long time asp.net and javascript coder.


Screen brightness access on device

Posted: Mon Sep 16, 2013 4:14 pm
by osiris1@yahoo.com

could not find any commands in PhoneGap to interact with the brightness control. Other than PhoneGap, are there any other plugins I could utilize with Appery to get the job done?


Screen brightness access on device

Posted: Mon Sep 16, 2013 4:16 pm
by maxkatz

I'm not aware of any other plug-ins. My guess is that there is no API to do that from the browser.


Screen brightness access on device

Posted: Mon Sep 16, 2013 4:29 pm
by osiris1@yahoo.com

i plan on compiling to a native IOS app at some point.


Screen brightness access on device

Posted: Mon Sep 16, 2013 4:39 pm
by maxkatz

If you use Appery.io -- it will be a hybrid app.


Screen brightness access on device

Posted: Mon Sep 16, 2013 4:43 pm
by osiris1@yahoo.com

Is there a way to place a black overlay over the screen to simulate brightness? I've seen some other apps that try this. It seems pretty effective. The slider changes the opaqueness, thus giving the illusion of adjusting brightness


Screen brightness access on device

Posted: Mon Sep 16, 2013 4:56 pm
by maxkatz

Sure, could be done via CSS.


Screen brightness access on device

Posted: Mon Sep 16, 2013 5:01 pm
by osiris1@yahoo.com

This css works, but how do I get it to interact with the slider control?

body.fadeMe {
opacity: 0.5;
background: #000;
width: 100%;
height: 100%;
z-index: 10;
top: 0;
left: 0;
position: fixed;
}

with javascript like: document.body.style.opacity=(Appery("Brightness_Slider").val())/100;