Adaptive brightness in android

1.1k views Asked by At

How can I implement adaptive brightness setting through my application to android device. I am able to change brightness level in manual mode. In case of automatic mode I am using sensor manager to detect ambient light sensor and according to light conditions the brightness should be set as well as the seekbar should also update.

Thanks

1

There are 1 answers

2
euitam On

If you want to change the brightness levels in auto mode, you have to use the undocumented constant screen_auto_brightness_adj like that:

Settings.System.putFloat(contentResolver, "screen_auto_brightness_adj", value);

value is a float and has to be between -1 and 1. This will adjust the brightness intensity more or less in adaptative brightness mode.

But beware as it is an undocumented and non public constant, Google may change this value in the future, so it could lead your code to crash or not work as expected.