Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Android Sets the system screen brightness     - Enterprise-class GitHub warehousing environment build (Server)

- ISO image to use offline upgrade Ubuntu (Linux)

- Linux character device - automatically creates the device nodes and devices (Linux)

- Teach you how to ensure password security under the Linux operating system (Linux)

- Actual custom yum repository ---- gem commands commonly used parameters (Linux)

- Installation Sublime Text 3 (Build 3065) text editor in Ubuntu (Linux)

- Linux, Chrome browser font settings beautification (Linux)

- Linux three ways to set environment variables (Linux)

- Iptables Instructions (Linux)

- MySQL query plan key_len know all (Database)

- Ubuntu users to install voice switch instructs the applet (Linux)

- MySQL + Heartbeat + DRBD deployment architecture (Server)

- LVM mirrored logical volume to achieve (Linux)

- SELinux security permissions HTTP + PHP service changes (Server)

- To install HDRMerge 0.4.3 under ubuntu (Linux)

- Understanding Java classes (Programming)

- ORA-4031 error Solution (Database)

- Two strokes to improve development productivity Struts2 (Programming)

- To protect the temporary files for Linux security (Linux)

- MySQL group_con cat_max_Len (Database)

 
         
  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:      
 
- Hive handle count distinct inclination to produce data processing (Database)
- PHP CURL get cookies simulated login (Database)
- How to use the on-screen keyboard in Linux (Linux)
- How to configure a development environment elegant Lua (Linux)
- 14 useful example Linux Sort command (Linux)
- Function Getting the Linux shell (Programming)
- C ++ runtime environment built on CentOS 6.6 and Oracle database connection (Database)
- String JavaScript type system (Programming)
- Linux Basics Tutorial: create your own Vim IDE (Linux)
- To resolve Ubuntu 14.04 Unity Desktop Environment Login freeze problem (Linux)
- Some common regular expressions (Linux)
- Construction Spark source and application development environment (Server)
- PLSQL Developer synchronization table tools (Database)
- Simple Calendar C language (Programming)
- MySQL use benchmarking tool sysbench (Database)
- Using Android Studio integrated development environment to build Android (Linux)
- How to use SHA256 checksum files download (Linux)
- Linux iptables: combat scenes (Linux)
- PostgreSQL 9.3.5 database installation under Ubuntu Server 14.04 (Database)
- Good wireless network security information spread in the air (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.