Screen Brightness in Android can be controlled programmatically in simple way. This tutorial explains the process with an example. Native brightness control in Android device has a Seekbar that adjust the screen brightness. The below tutorial has UI in a similar way.You take a look at SeekBar tutorial here if needed.
android.provider.Settings.System - This class contains miscellaneous system preferences. There are convenience functions for accessing individual system settings. android.provider.
Settings.System.getInt - Convenience function for retrieving a single system settings value as an integer. Note that internally setting values are always stored as strings; this function converts the string to an integer for you. The default value will be returned if the setting is not defined or not an integer.
android.provider.Settings.System.SCREEN_BRIGHTNESS - String that holds Screen Brightness value ranging from 0 to 255.
android.provider.Settings.System - This class contains miscellaneous system preferences. There are convenience functions for accessing individual system settings. android.provider.
Settings.System.getInt - Convenience function for retrieving a single system settings value as an integer. Note that internally setting values are always stored as strings; this function converts the string to an integer for you. The default value will be returned if the setting is not defined or not an integer.
android.provider.Settings.System.SCREEN_BRIGHTNESS - String that holds Screen Brightness value ranging from 0 to 255.