博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android中的android.provider.Settings.System系统属性设定
阅读量:4056 次
发布时间:2019-05-25

本文共 7157 字,大约阅读时间需要 23 分钟。

Content Provider中的Setting.System表格内存储了很多系统属性的值,以键值对的形式存在!

可以对如下的变量进行设置

Constants
Control whether the accelerometer will be used to change screen orientation.
This constant is deprecated. Use instead
Whether Airplane Mode is on.
A comma separated list of radios that need to be disabled when airplane mode is on.
Persistent store for the system-wide default alarm alert.
If 1, the activity manager will aggressively finish activities and processes as soon as they are no longer needed.
This constant is deprecated. Use instead
Appended to various volume related settings to record the previous values before they the settings were affected by a silent/vibrate ringer mode change.
Value to specify if the user prefers the date, time and time zone to be automatically fetched from the network (NITZ).
Value to specify if the user prefers the time zone to be automatically fetched from the network (NITZ).
Determines whether remote devices may discover and/or connect to this device.
Bluetooth discoverability timeout.
This constant is deprecated. Use instead
This constant is deprecated. Use instead
Date format string mm/dd/yyyy dd/mm/yyyy yyyy/mm/dd
Name of an application package to be debugged.
This constant is deprecated. Use instead
Whether or not to dim the screen.
Whether the audible DTMF tones are played by the dialer when dialing.
What happens when the user presses the end call button if they're not on a call.
Scaling factor for fonts, float.
Whether the haptic feedback (long presses, ...) are enabled.
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
Ringer mode.
Determines which streams are affected by ringer mode changes.
Determines which streams are affected by mute.
This constant is deprecated. Use instead
A formatted string of the next alarm that is set, or the empty string if there is no alarm set.
Persistent store for the system-wide default notification sound.
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
Constant for use in AIRPLANE_MODE_RADIOS to specify NFC radio.
Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
Persistent store for the system-wide default ringtone URI.
The screen backlight brightness between 0 and 255.
Control whether to enable automatic brightness mode.
int SCREEN_BRIGHTNESS_MODE value for automatic mode.
int SCREEN_BRIGHTNESS_MODE value for manual mode.
The timeout before the screen turns off.
This constant is deprecated. Use instead
Whether the setup wizard has been run before (on first boot), or if it still needs to be run.
 
Control whether the process CPU usage meter should be shown.
This constant is deprecated. Each application that shows web suggestions should have its own setting for this.
Whether the sounds effects (key clicks, lid open ...) are enabled.
Whether we keep the device on while the device is plugged in.
 
Setting to enable Auto Caps in text editors.
Setting to enable Auto Punctuate in text editors.
Setting to enable Auto Replace (AutoText) in text editors.
Setting to showing password characters in text editors.
Display times as 12 or 24 hours 12 24
Scaling factor for activity transition animations.
This constant is deprecated. Use instead
Default screen rotation when no other policy applies.
This constant is deprecated. Use instead
Whether vibrate is on for different events.
Alarm volume.
Bluetooth Headset volume.
Music/media/gaming volume.
Notification volume.
Ringer volume.
System/notifications volume.
Voice call volume.
If 1, when launching DEBUG_APP it will wait for the debugger before starting user code.
Name of activity to use for wallpaper on the home screen.
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
The policy for deciding when Wi-Fi should go to sleep (which will in turn switch to using the mobile data as an Internet connection).
int Value for to use the default Wi-Fi sleep policy, which is to sleep shortly after the turning off according to the setting.
int Value for to never go to sleep.
int Value for to use the default policy when the device is on battery, and never go to sleep when the device is plugged in.
If using static IP, the primary DNS's IP address.
If using static IP, the secondary DNS's IP address.
If using static IP, the gateway's IP address.
The static IP address.
If using static IP, the net mask.
Whether to use static IP and other static network attributes.
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
This constant is deprecated. Use instead
Scaling factor for normal window animations.

通过如下的函数可以对其进行读写:

static void ( cr, outConfig)
Convenience function to read all of the current configuration-related settings into a
object.
static float ( cr, name, float def)
Convenience function for retrieving a single system settings value as a floating point number.
static float ( cr, name)
Convenience function for retrieving a single system settings value as a float.
static int ( cr, name)
Convenience function for retrieving a single system settings value as an integer.
static int ( cr, name, int def)
Convenience function for retrieving a single system settings value as an integer.
static long ( cr, name, long def)
Convenience function for retrieving a single system settings value as a
long.
static long ( cr, name)
Convenience function for retrieving a single system settings value as a
long.
static boolean ( cr)
synchronized static ( resolver, name)
Look up a name in the database.
static ( name)
Construct the content URI for a particular name/value pair, useful for monitoring changes with a ContentObserver.
static boolean ( cr, config)
Convenience function to write a batch of configuration-related settings from a
object.
static boolean ( cr, name, float value)
Convenience function for updating a single settings value as a floating point number.
static boolean ( cr, name, int value)
Convenience function for updating a single settings value as an integer.
static boolean ( cr, name, long value)
Convenience function for updating a single settings value as a long integer.
static boolean ( resolver, name, value)
Store a name/value pair into the database.
static void ( cr, boolean flag)

注意,应用程序中应加入: <uses-permission android:name="android.permission.WRITE_SETTINGS" />

转载地址:http://dpqci.baihongyu.com/

你可能感兴趣的文章