`

Android 获取系统设置参数。

 
阅读更多
下面以获取时间格式为例,来判断时间是24小时制还是12小时制

        ContentResolver cv = this.getContentResolver();
        String strTimeFormat = android.provider.Settings.System.getString(cv,
                                           android.provider.Settings.System.TIME_12_24);
        
        if(strTimeFormat.equals("24"))

       {
              Log.i("activity","24");
        }

  System的其他参数如下:

 

Constants
String ACCELEROMETER_ROTATION Control whether the accelerometer will be used to change screen orientation.
String ADB_ENABLED This constant is deprecated. Use ADB_ENABLED instead
String AIRPLANE_MODE_ON Whether Airplane Mode is on.
String AIRPLANE_MODE_RADIOS A comma separated list of radios that need to be disabled when airplane mode is on.
String ALARM_ALERT Persistent store for the system-wide default alarm alert.
String ALWAYS_FINISH_ACTIVITIES If 1, the activity manager will aggressively finish activities and processes as soon as they are no longer needed.
String ANDROID_ID This constant is deprecated. Use ANDROID_ID instead
String APPEND_FOR_LAST_AUDIBLE Appended to various volume related settings to record the previous values before they the settings were affected by a silent/vibrate ringer mode change.
String AUTO_TIME Value to specify if the user prefers the date, time and time zone to be automatically fetched from the network (NITZ).
String AUTO_TIME_ZONE Value to specify if the user prefers the time zone to be automatically fetched from the network (NITZ).
String BLUETOOTH_DISCOVERABILITY Determines whether remote devices may discover and/or connect to this device.
String BLUETOOTH_DISCOVERABILITY_TIMEOUT Bluetooth discoverability timeout.
String BLUETOOTH_ON This constant is deprecated. Use BLUETOOTH_ON instead
String DATA_ROAMING This constant is deprecated. Use DATA_ROAMING instead
String DATE_FORMAT Date format string mm/dd/yyyy dd/mm/yyyy yyyy/mm/dd
String DEBUG_APP Name of an application package to be debugged.
String DEVICE_PROVISIONED This constant is deprecated. Use DEVICE_PROVISIONED instead
String DIM_SCREEN Whether or not to dim the screen.
String DTMF_TONE_WHEN_DIALING Whether the audible DTMF tones are played by the dialer when dialing.
String END_BUTTON_BEHAVIOR What happens when the user presses the end call button if they're not on a call.
String FONT_SCALE Scaling factor for fonts, float.
String HAPTIC_FEEDBACK_ENABLED Whether the haptic feedback (long presses, ...) are enabled.
String HTTP_PROXY This constant is deprecated. Use HTTP_PROXY instead
String INSTALL_NON_MARKET_APPS This constant is deprecated. Use INSTALL_NON_MARKET_APPS instead
String LOCATION_PROVIDERS_ALLOWED This constant is deprecated. Use LOCATION_PROVIDERS_ALLOWED instead
String LOCK_PATTERN_ENABLED This constant is deprecated. Use LOCK_PATTERN_ENABLED instead
String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED This constant is deprecated. Use LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED instead
String LOCK_PATTERN_VISIBLE This constant is deprecated. Use LOCK_PATTERN_VISIBLE instead
String LOGGING_ID This constant is deprecated. Use LOGGING_ID instead
String MODE_RINGER Ringer mode.
String MODE_RINGER_STREAMS_AFFECTED Determines which streams are affected by ringer mode changes.
String MUTE_STREAMS_AFFECTED Determines which streams are affected by mute.
String NETWORK_PREFERENCE This constant is deprecated. Use NETWORK_PREFERENCE instead
String NEXT_ALARM_FORMATTED A formatted string of the next alarm that is set, or the empty string if there is no alarm set.
String NOTIFICATION_SOUND Persistent store for the system-wide default notification sound.
String PARENTAL_CONTROL_ENABLED This constant is deprecated. Use PARENTAL_CONTROL_ENABLED instead
String PARENTAL_CONTROL_LAST_UPDATE This constant is deprecated. Use PARENTAL_CONTROL_LAST_UPDATE instead
String PARENTAL_CONTROL_REDIRECT_URL This constant is deprecated. Use PARENTAL_CONTROL_REDIRECT_URL instead
String RADIO_BLUETOOTH Constant for use in AIRPLANE_MODE_RADIOS to specify Bluetooth radio.
String RADIO_CELL Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
String RADIO_WIFI Constant for use in AIRPLANE_MODE_RADIOS to specify Wi-Fi radio.
String RINGTONE Persistent store for the system-wide default ringtone URI.
String SCREEN_BRIGHTNESS The screen backlight brightness between 0 and 255.
String SCREEN_BRIGHTNESS_MODE Control whether to enable automatic brightness mode.
int SCREEN_BRIGHTNESS_MODE_AUTOMATIC SCREEN_BRIGHTNESS_MODE value for manual mode.
int SCREEN_BRIGHTNESS_MODE_MANUAL SCREEN_BRIGHTNESS_MODE value for manual mode.
String SCREEN_OFF_TIMEOUT The timeout before the screen turns off.
String SETTINGS_CLASSNAME This constant is deprecated. Use SETTINGS_CLASSNAME instead
String SETUP_WIZARD_HAS_RUN Whether the setup wizard has been run before (on first boot), or if it still needs to be run.
String SHOW_GTALK_SERVICE_STATUS  
String SHOW_PROCESSES Control whether the process CPU usage meter should be shown.
String SHOW_WEB_SUGGESTIONS This constant is deprecated. Each application that shows web suggestions should have its own setting for this.
String SOUND_EFFECTS_ENABLED Whether the sounds effects (key clicks, lid open ...) are enabled.
String STAY_ON_WHILE_PLUGGED_IN Whether we keep the device on while the device is plugged in.
String SYS_PROP_SETTING_VERSION  
String TEXT_AUTO_CAPS Setting to enable Auto Caps in text editors.
String TEXT_AUTO_PUNCTUATE Setting to enable Auto Punctuate in text editors.
String TEXT_AUTO_REPLACE Setting to enable Auto Replace (AutoText) in text editors.
String TEXT_SHOW_PASSWORD Setting to showing password characters in text editors.
String TIME_12_24 Display times as 12 or 24 hours 12 24
String TRANSITION_ANIMATION_SCALE Scaling factor for activity transition animations.
String USB_MASS_STORAGE_ENABLED This constant is deprecated. Use USB_MASS_STORAGE_ENABLED instead
String USER_ROTATION Default screen rotation when no other policy applies.
String USE_GOOGLE_MAIL This constant is deprecated. Use USE_GOOGLE_MAIL instead
String VIBRATE_ON Whether vibrate is on for different events.
String VOLUME_ALARM Alarm volume.
String VOLUME_BLUETOOTH_SCO Bluetooth Headset volume.
String VOLUME_MUSIC Music/media/gaming volume.
String VOLUME_NOTIFICATION Notification volume.
String VOLUME_RING Ringer volume.
String VOLUME_SYSTEM System/notifications volume.
String VOLUME_VOICE Voice call volume.
String WAIT_FOR_DEBUGGER If 1, when launching DEBUG_APP it will wait for the debugger before starting user code.
String WALLPAPER_ACTIVITY Name of activity to use for wallpaper on the home screen.
String WIFI_MAX_DHCP_RETRY_COUNT This constant is deprecated. Use WIFI_MAX_DHCP_RETRY_COUNT instead
String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS This constant is deprecated. UseWIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS instead
String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON This constant is deprecated. Use WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON instead
String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY This constant is deprecated. Use WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY instead
String WIFI_NUM_OPEN_NETWORKS_KEPT This constant is deprecated. Use WIFI_NUM_OPEN_NETWORKS_KEPT instead
String WIFI_ON This constant is deprecated. Use WIFI_ON instead
String WIFI_SLEEP_POLICY 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 WIFI_SLEEP_POLICY_DEFAULT Value for WIFI_SLEEP_POLICY to use the default Wi-Fi sleep policy, which is to sleep shortly after the turning off according to the STAY_ON_WHILE_PLUGGED_IN setting.
int WIFI_SLEEP_POLICY_NEVER Value for WIFI_SLEEP_POLICY to never go to sleep.
int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED Value for WIFI_SLEEP_POLICY to use the default policy when the device is on battery, and never go to sleep when the device is plugged in.
String WIFI_STATIC_DNS1 If using static IP, the primary DNS's IP address.
String WIFI_STATIC_DNS2 If using static IP, the secondary DNS's IP address.
String WIFI_STATIC_GATEWAY If using static IP, the gateway's IP address.
String WIFI_STATIC_IP The static IP address.
String WIFI_STATIC_NETMASK If using static IP, the net mask.
String WIFI_USE_STATIC_IP Whether to use static IP and other static network attributes.
String WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE This constant is deprecated. UseWIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE instead
String WIFI_WATCHDOG_AP_COUNT This constant is deprecated. Use WIFI_WATCHDOG_AP_COUNT instead
String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS This constant is deprecated. Use WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS instead
String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED This constant is deprecated. Use WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED instead
String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS This constant is deprecated. Use WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MSinstead
String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT This constant is deprecated. Use WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNTinstead
String WIFI_WATCHDOG_MAX_AP_CHECKS This constant is deprecated. Use WIFI_WATCHDOG_MAX_AP_CHECKS instead
String WIFI_WATCHDOG_ON This constant is deprecated. Use WIFI_WATCHDOG_ON instead
String WIFI_WATCHDOG_PING_COUNT This constant is deprecated. Use WIFI_WATCHDOG_PING_COUNT instead
String WIFI_WATCHDOG_PING_DELAY_MS This constant is deprecated. Use WIFI_WATCHDOG_PING_DELAY_MS instead
String WIFI_WATCHDOG_PING_TIMEOUT_MS This constant is deprecated. Use WIFI_WATCHDOG_PING_TIMEOUT_MS instead
String WINDOW_ANIMATION_SCALE Scaling factor for normal window animations.
分享到:
评论

相关推荐

    android读取系统参数工程

    android读取系统参数工程 android读取系统参数工程 android读取系统参数工程

    详解Android获得系统GPU参数 gl.glGetString

    主要介绍了详解Android获得系统GPU参数 gl.glGetString的相关资料,需要的朋友可以参考下

    android系统函数大全.pdf

    Android 系统函数大全 Android 系统提供了多种函数来控制和管理屏幕显示、菜单控制、查询控制、任务切换和按键响应等功能。本文将对这些函数进行详细的介绍和解释。 屏幕显示函数 Android 系统提供了多种函数来...

    android使用GPS获取当前地理位置

    第一:当使用GPS定位时,最好不要使用getLastKnownLocation方法获得当前位置对象Location,因为该对 象可以在onLocationChanged的参数中由系统给予(根据文档,getLastKnownLocation有2方面功能:1. 获取当前地理...

    Android A/B分区OTA系统升级应用层调用UpdateEngine Apk源码

    最近在搞 Android A/B 分区 OTA 升级,开始以为挺简单的一个事,没想到折腾了几天,还好终于搞定!代码调用其实就那么点,但是参数以及权限之类很关键,搬砖过来走不通,我就是卡了2天,一些莫名的错误,没法定位。...

    代码获取android开机启动时间,已经开机启动应用

    通过java 代码执行liunx系统命令并获取返回参数。 在android系统启动完成后,接受开机完毕启动广播,保存在share文件中。完成开机启动时间的记录。

    各种Android Dialog创建及其监听事件实现

    在Android开发中 我们经常会需要在Android界面上弹出一些对话框 比如询问用户或者让用户选择 关于Android Dialog的使用方法 已经有很多blog做出了详细的介绍(比如博客:7种形式的Android Dialog使用举例) 但是只是...

    android系统控制onvif协议摄像头app源码.rar

    android-onvif是一个基于android系统控制onvif协议摄像头的软件项目,例如海康摄像头等。本项目已将接口封装,使用简单。后续将扩展更多功能。。。 功能介绍 探索与发现摄像头 摄像头参数获取和获取 摄像头账号密码...

    新版Android开发教程.rar

    Android 的 App Market 模式,软件开发者获得 7 成收入, 3 成用于系统维护。难点在于位置营销。 设备商通过卖设备、内置特色应用来获得盈利。也可以兼职专业软件开发者进行赢利。 Google 自身通过基于统一平台为...

    基于Android平台的苹果叶病害远程识别系统.pdf

    该系统由Android客户端和PC服务器端组成,客户端通过系统相机获取图像,使用Socket流实现客户端与服务器通信,服务器端使用OTSU方法提取图像病斑部位,提取颜色、纹理、形状参数,并使用支持向量机实现病害识别。...

    ux操作系统性能调优的方法

    按照传统,Linux不同的发行版本和不同的内核对各项参数及设置均做了改动,从而使得系统能够获得更好的性能。下边将分四部分介绍在Red Hat Enterprise Linux AS和SUSE LINUX Enterprise Server系统下,如何用以下几种...

    Android 仿ios屏幕底部滑出的弹出菜单效果.rar

     获取Dialog布局、设置Dialog最小宽度为屏幕宽度、获取自定义Dialog布局中的控件、定义Dialog布局和参数、设置菜单条目布局、添加条目过多的时候控制高度、背景颜色字体和高度的设置等。  下载源码后请参考...

    Android开发案例驱动教程 配套代码

    10.7 为案例增加参数设置功能 238 10.7.1 Shared Preferences 240 10.7.2 Preferences控件介绍 243 10.7.3 使用Preferences控件的案例 248 本章小结 250 第11章 Content Provider 251 11.1 Content Provider...

    android Parcelable

    在Android开发过程中,经常要在Activity之间传递参数,使用Android系统提供的方法可以传递基本数据类型的变量,但有时候我们经常要传递一些复杂的数据类型或自定义的类,这种情况的参数无法直接传递,我们可以通过...

    android获取相册图片和路径的实现方法

    Android开发获取相册图片的方式网上有很多种,这里说一个Android4.4后的方法,因为版本越高,一些老的api就会被弃用...两个方法所得到的图片的uri是不一样的,用老的方法导致在Android4.4系统获取不到图片。 private

    android开发入门与实战(下)

    1.3.4 获得应有的收益——AndroidMarket 1.4 真实体验——Android模拟器 1.4.1 模拟器概述 1.4.2 模拟器和真机的区别 1.4.3 模拟器使用注意事项 1.5 更上一层楼——加入Android开发社区 1.6 本章小结 第2章 ...

    Android静默安装常用工具类

    前两个方法可以进行高级参数设置及丰富内容返回,第三个方法可以简单的传入url获取返回内容,httpPost类似。更详细的设置可以直接使用HttpURLConnection或apache的HttpClient。 源码可见HttpUtils.java,更多方法及...

    uniapp调用原生Android SDK

    uniapp调用原生Android SDK ,uniapp调用原生IOS SDK, uniapp 调用原生安卓sdkdemo

    Android调用系统拍照裁剪图片模糊的解决方法

    在Android中,调用系统相机拍照时,将会接收到返回的图像数据,但是这些图片并不是全尺寸的图像,而是系统给的缩略图,当对拍照的图片进行裁切后显示时,得到的却是模糊的图片。下面针对这个问题提出解决的方法。 ...

    Android注解框架AndroidInject.zip

     itemLongClickMethod[String]: 用于设置控件item长按的回调方法, 可选, 方法名任意, 参数必须为(AdapterView, View, int, long)  @AIBean: 属性注解, 为该属性生成一个对象并注入, 该对象必须有个默认...

Global site tag (gtag.js) - Google Analytics