Android examples for User Interface:Screen Brightness
set Screen Brightness against value 255
//package com.java2s; import android.content.Context; import android.provider.Settings; public class Main { public static boolean setScreenBrightness(Context context, int screenBrightness) { int brightness = screenBrightness; if (screenBrightness < 1) { brightness = 1;/*from w ww . j a va 2 s.c o m*/ } else if (screenBrightness > 255) { brightness = screenBrightness % 255; if (brightness == 0) { brightness = 255; } } boolean result = Settings.System.putInt( context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, brightness); return result; } }