转载自: http://blog.163.com/fang_wang2005/blog/static/176928073201136105613638/ 如何获取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. UseADB_ENABLEDinstead
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. UseANDROID_IDinstead
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. UseBLUETOOTH_ONinstead
String DATA_ROAMING This constant is deprecated. UseDATA_ROAMINGinstead
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. UseDEVICE_PROVISIONEDinstead
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. UseHTTP_PROXYinstead
String INSTALL_NON_MARKET_APPS This constant is deprecated. UseINSTALL_NON_MARKET_APPSinstead
String LOCATION_PROVIDERS_ALLOWED This constant is deprecated. UseLOCATION_PROVIDERS_ALLOWEDinstead
String LOCK_PATTERN_ENABLED This constant is deprecated. UseLOCK_PATTERN_ENABLEDinstead
String LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED This constant is deprecated. UseLOCK_PATTERN_TACTILE_FEEDBACK_ENABLEDinstead
String LOCK_PATTERN_VISIBLE This constant is deprecated. UseLOCK_PATTERN_VISIBLEinstead
String LOGGING_ID This constant is deprecated. UseLOGGING_IDinstead
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. UseNETWORK_PREFERENCEinstead
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. UsePARENTAL_CONTROL_ENABLEDinstead
String PARENTAL_CONTROL_LAST_UPDATE This constant is deprecated. UsePARENTAL_CONTROL_LAST_UPDATEinstead
String PARENTAL_CONTROL_REDIRECT_URL This constant is deprecated. UsePARENTAL_CONTROL_REDIRECT_URLinstead
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. UseSETTINGS_CLASSNAMEinstead
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. UseUSB_MASS_STORAGE_ENABLEDinstead
String USER_ROTATION Default screen rotation when no other policy applies.
String USE_GOOGLE_MAIL This constant is deprecated. UseUSE_GOOGLE_MAILinstead
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. UseWIFI_MAX_DHCP_RETRY_COUNTinstead
String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS This constant is deprecated. UseWIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MSinstead
String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON This constant is deprecated. UseWIFI_NETWORKS_AVAILABLE_NOTIFICATION_ONinstead
String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY This constant is deprecated. UseWIFI_NETWORKS_AVAILABLE_REPEAT_DELAYinstead
String WIFI_NUM_OPEN_NETWORKS_KEPT This constant is deprecated. UseWIFI_NUM_OPEN_NETWORKS_KEPTinstead
String WIFI_ON This constant is deprecated. UseWIFI_ONinstead
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 forWIFI_SLEEP_POLICYto use the default Wi-Fi sleep policy, which is to sleep shortly after the turning off according to theSTAY_ON_WHILE_PLUGGED_INsetting.
int WIFI_SLEEP_POLICY_NEVER Value forWIFI_SLEEP_POLICYto never go to sleep.
int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED Value forWIFI_SLEEP_POLICYto 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_PERCENTAGEinstead
String WIFI_WATCHDOG_AP_COUNT This constant is deprecated. UseWIFI_WATCHDOG_AP_COUNTinstead
String WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS This constant is deprecated. UseWIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MSinstead
String WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED This constant is deprecated. UseWIFI_WATCHDOG_BACKGROUND_CHECK_ENABLEDinstead
String WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS This constant is deprecated. UseWIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MSinstead
String WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT This constant is deprecated. UseWIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNTinstead
String WIFI_WATCHDOG_MAX_AP_CHECKS This constant is deprecated. UseWIFI_WATCHDOG_MAX_AP_CHECKSinstead
String WIFI_WATCHDOG_ON This constant is deprecated. UseWIFI_WATCHDOG_ONinstead
String WIFI_WATCHDOG_PING_COUNT This constant is deprecated. UseWIFI_WATCHDOG_PING_COUNTinstead
String WIFI_WATCHDOG_PING_DELAY_MS This constant is deprecated. UseWIFI_WATCHDOG_PING_DELAY_MSinstead
String WIFI_WATCHDOG_PING_TIMEOUT_MS This constant is deprecated. UseWIFI_WATCHDOG_PING_TIMEOUT_MSinstead
String WINDOW_ANIMATION_SCALE Scaling factor for normal window animations.

更多相关文章

  1. Android 学习笔记 Contacts (一)ContentResolver query 参数详解
  2. android:sharedUserId="android.uid.system" 使用系统签名+SNTP
  3. Android LayoutInflater的获取及inflate()参数和返回值
  4. Android中日期和时间控件的使用
  5. android 时间
  6. 关于build.gradle配置文件详细参数讲解
  7. android 线程中的ui问题 Handler的基本使用 关于获取动态时间在u
  8. android datepickerdialog 时间上下限问题

随机推荐

  1. android收货地址整理
  2. Android7.0中文文档(API) -- ActionMenuVie
  3. Android UI自动化测试最佳实
  4. android 实现透明按钮
  5. Android使用WebView来显示天气预报
  6. Android(安卓)PowerManagerService分析
  7. Android 弹出窗口 PopupWindow
  8. Edittext 设置
  9. layout_alignParentBottom失效
  10. 各种Layout用到的一些重要的属性