Java tutorial
//package com.java2s; import android.app.Activity; import android.content.ContentResolver; import android.net.Uri; import android.provider.Settings; public class Main { public static void saveBrightness(Activity activity, int brightness) { Uri uri = Settings.System.getUriFor("screen_brightness"); ContentResolver resolver = activity.getContentResolver(); Settings.System.putInt(resolver, "screen_brightness", brightness); resolver.notifyChange(uri, null); } }