views:

33

answers:

1

Hi, I want to control the system settings "auto brightness", setting it ON or OFF.I'm able to control the brightness level but only if AUTO is OFF. From what I read until now there is a SCREEN_BRIGHTNESS_MODE in Settings.System but only for API level 8 or higher and also not recommended to mess wit it. But currently my phone has Android 2.1 (API 7) and there are widgets that can control this setting (enable/disable auto brightness and set the level). How is this done ? Thanks.

A: 

Ok, problem solved :)

Alex
For the benefit of others, could you share how you solved your problem?
Brad Larson
Actually, I it like in API 8, except that you define the strings. It works in API 7, don't know if it's working in lower versions.private static final String SCREEN_BRIGHTNESS_MODE = "screen_brightness_mode";private static final int SCREEN_BRIGHTNESS_MODE_MANUAL = 0;private static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;Settings.System.putInt(resolver,SCREEN_BRIGHTNESS_MODE, mode);Settings.System.putInt(resolver,Settings.System.SCREEN_BRIGHTNESS,lev);
Alex