Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.res.Resources; public class Main { public static int getMinimumScreenBrightnessSetting(Context context) { final Resources res = Resources.getSystem(); int id = res.getIdentifier("config_screenBrightnessSettingMinimum", "integer", "android"); // API17+ if (id == 0) id = res.getIdentifier("config_screenBrightnessDim", "integer", "android"); // lower API levels if (id != 0) { try { return res.getInteger(id); } catch (Resources.NotFoundException e) { // ignore } } return 0; } }