Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Android Sets the system screen brightness     - Linux kernel RCU (Read Copy Update) lock Brief - prequel (Linux)

- Oracle 11g tracking and monitoring system-level triggers to drop misuse (Database)

- QBit development of micro-services (Server)

- IntelliJ IDEA run in Mac10.9 and JDK7 environment (Linux)

- Linux Security trust with users (Linux)

- OpenSSH version smooth upgrade method (Linux)

- To install Docker under Ubuntu 15.04 (Linux)

- Linux System Getting Started Tutorial: How to Force Change your password at next logon Linux (Linux)

- Linux - Common process the command (Linux)

- Android Studio Getting Started Hello World (Programming)

- shellinabox: one uses AJAX Web-based terminal emulator (Linux)

- 64 Ubuntu 15.04 Linux kernel upgrade to Linux 4.1.0 (Linux)

- Asynchronous JavaScript loading (Programming)

- HBase Application Development Review and Summary of Series (Database)

- Ubuntu and derivative users to install the system launcher SimDock 1.3 (Linux)

- Linux5.8 installed phpMyAdmin was unable to issue related php-mcrypt (Database)

- Ubuntu 12.04 LTS installation configuration JDK1.6.0_45 (Linux)

- These days have been tossing in the Linux under the ASP.NET 5, on the next in the other operating systems in the ASP.NET 5 or. NET applications, in order to complete the MS VM (CoreCLR) run is not far Reach, the effect of the application.

Cur
(Server)

- Detailed usage history command (Linux)

- The basic principles of AIX system security (Linux)

 
         
  Android Sets the system screen brightness
     
  Add Date : 2017-08-31      
         
       
         
  Android Sets the system screen brightness

Permissions
< Uses-permission android: name = "android.permission.WRITE_SETTINGS"> < / uses-permission>
 
 
/ **
* Get the current screen brightness mode
* SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1 to automatically adjust the screen brightness
* SCREEN_BRIGHTNESS_MODE_MANUAL = 0 to adjust the screen brightness manually
* /
Private int getScreenMode () {
Int screenMode = 0;
Try {
ScreenMode = Settings.System.getInt (getContentResolver (), Settings.System.SCREEN_BRIGHTNESS_MODE);
}}
Catch (Exception localException) {

}}
Return screenMode;
}}

/ **
* Get the current screen brightness value 0--255
* /
Private int getScreenBrightness () {
Int screenBrightness = 255;
Try {
ScreenBrightness = Settings.System.getInt (getContentResolver (), Settings.System.SCREEN_BRIGHTNESS);
}}
Catch (Exception localException) {

}}
Return screenBrightness;
}}
/ **
* Sets the mode for the current screen brightness
* SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1 to automatically adjust the screen brightness
* SCREEN_BRIGHTNESS_MODE_MANUAL = 0 to adjust the screen brightness manually
* /
Private void setScreenMode (int paramInt) {
Try {
Settings.System.putInt (getContentResolver (), Settings.System.SCREEN_BRIGHTNESS_MODE, paramIn);
} Catch (Exception localException) {
LocalException.printStackTrace ();
}}
}}
/ **
* Set the current screen brightness value 0--255
* /
Private void saveScreenBrightness (int paramInt) {
Try {
Settings.System.putInt (getContentResolver (), Settings.System.SCREEN_BRIGHTNESS, paramInt);
}}
Catch (Exception localException) {
LocalException.printStackTrace ();
}}
}}
/ **
* Save the current screen brightness value, and make it effective
* /
Private void setScreenBrightness (int paramInt) {
Window localWindow = getWindow ();
WindowManager.LayoutParams localLayoutParams = localWindow.getAttributes ();
Float f = paramInt / 255.0F;
LocalLayoutParams.screenBrightness = f;
LocalWindow.setAttributes (localLayoutParams);
}}
     
         
       
         
  More:      
 
- Via Twitter how open source library to be used anywhere Emoji emoticons (Linux)
- Java memory area Explanation (Programming)
- AWK principles and commands and file input (Linux)
- Linux System Getting Started Tutorial: how to find information on Linux-embedded module (Linux)
- RedHat virtual machine to install VMware Tools (Linux)
- RPM package fabrication method (Linux)
- Some common regular expressions (Linux)
- Disable unnecessary services under Linux (Linux)
- To_teach you three strategies to prevent the LAN IP address theft (Linux)
- The Oracle VM VirtualBox use U disk under ubuntu (Linux)
- Practical top command (Linux)
- RCU lock in the evolution of the Linux kernel (Linux)
- Using IE can also be easily remotely control the computer (Linux)
- Ubuntu resolve sudo: source: command not found error (Linux)
- mysqldump MySQL command-line tool (Database)
- CentOS 6.4 Telecom ADSL dial-up network configuration (Linux)
- Oracle conditional select statements and looping statements (Database)
- linux server security (Linux)
- Ubuntu 15.04 / CentOS 7.0 to set custom boot (Linux)
- CentOS 6 Install Linux kernel source (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.