Java tutorial
//package com.java2s; import android.content.ContentResolver; import android.content.Context; import android.provider.Settings; public class Main { public static void setAutoAdjustBrightness(Context context, boolean auto) { int value = 0; if (auto) { value = Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC; } else { value = Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL; } ContentResolver cr = context.getContentResolver(); Settings.System.putInt(cr, Settings.System.SCREEN_BRIGHTNESS_MODE, value); } }