How to Detect Screen Brightness Range on Android
In this article
To detect the screen brightness range on Android, you need to read the system's brightness limits and the current brightness value through the Android SDK—specifically by querying Settings.System.SCREEN_BRIGHTNESS for the current level and using PowerManager or display APIs to find the maximum. There is no single user-facing setting that shows a "brightness range" number; you have to retrieve it programmatically or use a diagnostic app. The exact method depends on whether you are a developer writing code or a user who just wants to see the numbers.
What You'll Need
- An Android device running Android 6.0 (API 23) or later—most modern phones qualify.
- For developers: Android Studio (or another IDE) with the Android SDK installed, and a basic Android project set up.
- For non-developers: a diagnostic app from the Google Play Store that reports display and brightness information, or a terminal app if you prefer command-line tools.
- If you are coding: the
WRITE_SETTINGSpermission is only needed if you plan to change brightness, not just read it. Reading the current brightness viaSettings.Systemdoes not require a special permission on most versions, but some manufacturer skins may restrict it.
Note that menu labels and API behavior can differ slightly by Android version, device manufacturer, and region. The steps below describe the standard Android approach; Samsung, Xiaomi, and other skins may add or rename items.
Step-by-Step
- Decide whether you need code or a visual check. If you are building an app or automation, use the programmatic method in steps 2–6. If you just want to see the numbers on your own phone, skip to step 7.
- Get the current brightness value. In your Android code, call
Settings.System.getInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS). This returns an integer. On most devices the value ranges from 0 to 255, but some manufacturers use a wider range (for example, 0–2047 or 0–4095). Do not assume 255 is the maximum. - Find the maximum brightness. The reliable way is to read the system's brightness configuration. Use
PowerManagerand the display's supported modes, or query the resource array that defines brightness levels. A common approach is to callgetResources().getIntArray(com.android.internal.R.array.config_screenBrightnessSettingMaximum)—but that internal resource is not part of the public SDK and may not be accessible. Instead, use the public API: on Android 8.0 (API 26) and later,Display.getSupportedModes()gives display modes, but brightness maximum is better obtained fromPowerManagervia reflection or from theSettings.System.SCREEN_BRIGHTNESS_MODEcombined with a known device profile. For a public, supported method, read the maximum from the device's brightness slider range by queryingSettings.System.SCREEN_BRIGHTNESSafter setting it to a known high value—but that requires write permission. The cleanest public approach is to use theDisplayManagerandDisplay.getHdrCapabilities()for HDR brightness, or to accept that the maximum is device-specific and read it from a configuration file or a diagnostic app. - Use a diagnostic app for a quick readout. Install a reputable app such as "Device Info HW" or "CPU-Z" from the Play Store. Open it and look for a "Display" or "Screen" section. These apps often show the current brightness in lux or as a percentage, and some show the raw brightness value. This is the fastest way for non-developers.
- Check the brightness slider range manually. Open Settings > Display > Brightness level (labels vary). Drag the slider to the minimum and maximum. Note the visual difference. This does not give you a numeric range but confirms the usable span. Some phones show a percentage; others do not.
- For developers: log the values. Add a
Log.d("Brightness", "Current: " + currentBrightness)in your code and run the app on your device. Then change the brightness with the system slider and log again. This shows you the actual range your device reports. - Handle adaptive brightness. If adaptive brightness is on, the system may override your readings. Check
Settings.System.SCREEN_BRIGHTNESS_MODE: 0 means manual, 1 means automatic. In automatic mode, the current brightness changes with ambient light, so the "range" you see is dynamic. For a stable reading, turn adaptive brightness off temporarily in Settings > Display. - Test on multiple devices if you are shipping an app. Brightness ranges vary widely. A value of 255 might be maximum on one phone and mid-range on another. Always normalize by dividing the current value by the maximum you detect, and never hard-code 255.
Common Mistakes
- Assuming the maximum is 255. Many devices use 0–255, but others use 0–1023, 0–2047, or 0–4095. Always read the maximum from the system or normalize using a percentage.
- Forgetting about adaptive brightness. If auto-brightness is on, the current value fluctuates. Turn it off for consistent readings.
- Using internal APIs. Resources like
com.android.internal.R.array.config_screenBrightnessSettingMaximumare not part of the public SDK and will break on some devices or Android versions. Prefer public APIs or diagnostic apps. - Ignoring manufacturer skins. Samsung, Xiaomi, and others may cap brightness differently or expose additional brightness modes (e.g., "Extra brightness" on some Samsung phones). Test on the actual device.
- Expecting a user-facing setting. Android does not show a "brightness range" number in Settings. You need code or a third-party app.
Tips
- Use
Settings.System.SCREEN_BRIGHTNESSfor the current value and normalize it to a 0–100% scale by dividing by the detected maximum. - If you need the maximum for UI purposes, consider using the
WindowManager.LayoutParams.screenBrightnessrange, which is 0.0 to 1.0 for per-window brightness—this is a float and is consistent across devices. - For HDR content, check
Display.getHdrCapabilities()to see peak luminance values, which are separate from the standard brightness range. - Keep a fallback: if you cannot detect the maximum, assume 255 and clamp values accordingly, but log a warning.
- On Android 12 and later, some brightness APIs changed; check the official Android developer documentation for the latest
DisplayandPowerManagermethods.
Troubleshooting
- Values look wrong or stuck at 0. Ensure you are reading from the correct content resolver and that the app has no restrictions. On some devices, reading
Settings.Systemrequires theREAD_SETTINGSpermission, which is not publicly grantable—use a diagnostic app instead. - Maximum detection fails. If reflection or internal resources fail, fall back to a percentage-based approach using
WindowManager.LayoutParams.screenBrightness(0.0–1.0) for your own app's window, or ask the user to set brightness manually. - Adaptive brightness interferes. Turn off auto-brightness in Settings > Display and retest. If the setting is grayed out, check for a battery saver or accessibility service that controls brightness.
- App crashes on a specific device. Wrap brightness reads in a try-catch and provide a default. Some manufacturer skins throw
SettingNotFoundException. - Diagnostic app shows different numbers. Different apps may report raw values vs. percentages. Cross-check with the system slider and the app's documentation.
Frequently Asked Questions
Can I see the brightness range without coding?
Not directly in Android Settings. Install a diagnostic app like Device Info HW from the Play Store and check its display section for brightness values.
What is the typical maximum brightness value?
It varies. Many devices use 255, but some use 1023, 2047, or 4095. Always detect it rather than assuming.
Does adaptive brightness change the range?
It changes the current brightness dynamically, but the hardware range stays the same. Turn off auto-brightness for stable readings.
Why does my code return 0 for brightness?
The setting may be unavailable or restricted on your device. Try a diagnostic app or use WindowManager.LayoutParams.screenBrightness for your own window.
Can I read brightness on Android 13 and later?
Yes, the public APIs still work, but some internal resources are restricted. Use public methods and test on your target devices.
Is there a system API for maximum brightness?
There is no single public API that returns the maximum for all devices. You can use Display.getHdrCapabilities() for HDR peak luminance, or normalize using a percentage approach.