【Android项目中的config.xml文件 “config.xml”】采得百花成蜜后,为谁辛苦为谁甜。这篇文章主要讲述Android项目中的config.xml文件 “config.xml”相关的知识,希望能为你提供帮助。
android应用程序需要保存一些配置时,可以将这些配置项放置到values/config.xml文件中。
实例分析:
< ?xml version="1.0" encoding="utf-8"?> < !-- /* ** Copyright 2009, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** **http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ --> < !-- These resources are around just to allow their values to be customized for different hardware and product builds. --> < resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> < !-- Do not translate. Defines the slots for the right-hand side icons.That is to say, the icons in the status bar that are not notifications. --> < string-array name="config_statusBarIcons"> < item> < xliff:g id="id"> ime< /xliff:g> < /item> < item> < xliff:g id="id"> sync_failing< /xliff:g> < /item> < item> < xliff:g id="id"> sync_active< /xliff:g> < /item> < item> < xliff:g id="id"> gps< /xliff:g> < /item> < item> < xliff:g id="id"> bluetooth< /xliff:g> < /item> < item> < xliff:g id="id"> nfc< /xliff:g> < /item> < item> < xliff:g id="id"> tty< /xliff:g> < /item> < item> < xliff:g id="id"> speakerphone< /xliff:g> < /item> < item> < xliff:g id="id"> mute< /xliff:g> < /item> < item> < xliff:g id="id"> volume< /xliff:g> < /item> < item> < xliff:g id="id"> wifi< /xliff:g> < /item> < item> < xliff:g id="id"> cdma_eri< /xliff:g> < /item> < item> < xliff:g id="id"> data_connection< /xliff:g> < /item> < item> < xliff:g id="id"> phone_evdo_signal< /xliff:g> < /item> < item> < xliff:g id="id"> phone_signal< /xliff:g> < /item> < item> < xliff:g id="id"> battery< /xliff:g> < /item> < item> < xliff:g id="id"> alarm_clock< /xliff:g> < /item> < item> < xliff:g id="id"> secure< /xliff:g> < /item> < item> < xliff:g id="id"> clock< /xliff:g> < /item> < /string-array> < !-- Flag indicating whether the surface flinger has limited alpha compositing functionality in hardware.If set, the window manager will disable alpha trasformation in animations where not strictly needed. --> < bool name="config_sf_limitedAlpha"> false< /bool> < !-- Default value used to block data calls if ims is not connected.If you use the ims apn DCT will block any other apn from connecting until ims apn is connected--> < bool name="ImsConnectedDefaultValue"> false< /bool> < !-- Flag indicating whether the surface flinger is inefficient at performing a blur.Used by parts of the UI to turn off the blur effect where it isn‘t worth the performance hit. As of Honeycomb, blurring is not supported anymore. --> < bool name="config_sf_slowBlur"> true< /bool> < !-- The duration (in milliseconds) of a short animation. --> < integer name="config_shortAnimTime"> 200< /integer> < !-- The duration (in milliseconds) of a medium-length animation. --> < integer name="config_mediumAnimTime"> 400< /integer> < !-- The duration (in milliseconds) of a long animation. --> < integer name="config_longAnimTime"> 500< /integer> < !-- The duration (in milliseconds) of the activity open/close and fragment open/close animations. --> < integer name="config_activityShortDur"> 150< /integer> < integer name="config_activityDefaultDur"> 220< /integer> < !-- Duration for the dim animation behind a dialog.This may be either a percentage, which is relative to the duration of the enter/open animation of the window being shown that is dimming behind, or it may be an integer for a constant duration. --> < fraction name="config_dimBehindFadeDuration"> 100%< /fraction> < !-- The maximum width we would prefer dialogs to be.0 if there is no maximum (let them grow as large as the screen).Actual values are specified for -large and -xlarge configurations. --> < dimen name="config_prefDialogWidth"> 320dp< /dimen> < !-- Enables or disables fading edges when marquee is enabled in TextView. --> < bool name="config_ui_enableFadingMarquee"> true< /bool> < !-- Whether dialogs should close automatically when the user touches outside of them.This should not normally be modified. --> < bool name="config_closeDialogWhenTouchOutside"> true< /bool> < !-- The duration (in milliseconds) that the radio will scan for a signal when there‘s no network connection. If the scan doesn‘t timeout, use zero --> < integer name="config_radioscanningTimeout"> 0< /integer> < !-- XXXXX NOTE THE FOLLOWING RESOURCES USE THE WRONG NAMING CONVENTION. Please don‘t copy them, copy anything else. --> < !-- This string array should be overridden by the device to present a list of network attributes.This is used by the connectivity manager to decide which networks can coexist based on the hardware --> < !-- An Array of "[Connection name],[ConnectivityManager.TYPE_xxxx], [associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet]--> < !-- the 5th element "resore-time" indicates the number of milliseconds to delay before automatically restore the default connection.Set -1 if the connection does not require auto-restore. --> < !-- the 6th element indicates boot-time dependency-met value. --> < string-array translatable="false" name="networkAttributes"> < item> "wifi,1,1,1,-1,true"< /item> < item> "mobile,0,0,0,-1,true"< /item> < item> "mobile_mms,2,0,2,60000,true"< /item> < item> "mobile_supl,3,0,2,60000,true"< /item> < item> "mobile_hipri,5,0,3,60000,true"< /item> < item> "mobile_fota,10,0,2,60000,true"< /item> < item> "mobile_ims,11,0,2,60000,true"< /item> < item> "mobile_cbs,12,0,2,60000,true"< /item> < item> "wifi_p2p,13,1,0,-1,true"< /item> < /string-array> < !-- Array of ConnectivityManager.TYPE_xxxx constants for networks that may only be controlled by systemOrSignature apps.--> < integer-array translatable="false" name="config_protectedNetworks"> < item> 10< /item> < item> 11< /item> < item> 12< /item> < /integer-array> < !-- This string array should be overridden by the device to present a list of radio attributes.This is used by the connectivity manager to decide which networks can coexist based on the hardware --> < !-- An Array of "[ConnectivityManager connectionType], [# simultaneous connection types]"--> < string-array translatable="false" name="radioAttributes"> < item> "1,1"< /item> < item> "0,1"< /item> < /string-array> < !-- Set of NetworkInfo.getType() that reflect data usage. --> < integer-array translatable="false" name="config_data_usage_network_types"> < item> 0< /item> < !-- TYPE_MOBILE --> < item> 2< /item> < !-- TYPE_MOBILE_MMS --> < item> 3< /item> < !-- TYPE_MOBILE_SUPL --> < item> 4< /item> < !-- TYPE_MOBILE_DUN --> < item> 5< /item> < !-- TYPE_MOBILE_HIPRI --> < item> 10< /item> < !-- TYPE_MOBILE_FOTA --> < item> 11< /item> < !-- TYPE_MOBILE_IMS --> < item> 12< /item> < !-- TYPE_MOBILE_CBS --> < /integer-array> < !-- The maximum duration (in milliseconds) we expect a network transition to take --> < integer name="config_networkTransitionTimeout"> 60000< /integer> < !-- List of regexpressions describing the interface (if any) that represent tetherable USB interfaces.If the device doesn‘t want to support tething over USB this should be empty.An example would be "usb.*" --> < string-array translatable="false" name="config_tether_usb_regexs"> < /string-array> < !-- List of regexpressions describing the interface (if any) that represent tetherable Wifi interfaces.If the device doesn‘t want to support tethering over Wifi this should be empty.An example would be "softap.*" --> < string-array translatable="false" name="config_tether_wifi_regexs"> < /string-array> < !-- List of regexpressions describing the interface (if any) that represent tetherable WiMAX interfaces.If the device doesn‘t want to support tethering over Wifi this should be empty.An example would be "softap.*" --> < string-array translatable="false" name="config_tether_wimax_regexs"> < /string-array> < !-- List of regexpressions describing the interface (if any) that represent tetherable bluetooth interfaces.If the device doesn‘t want to support tethering over bluetooth this should be empty. --> < string-array translatable="false" name="config_tether_bluetooth_regexs"> < /string-array> < !-- Max number of Bluetooth tethering connections allowed. If this is updated config_tether_dhcp_range has to be updated appropriately. --> < integer translateable="false" name="config_max_pan_devices"> 5< /integer> < !-- Dhcp range (min, max) to use for tethering purposes --> < string-array translatable="false" name="config_tether_dhcp_range"> < /string-array> < !-- Regex of wired ethernet ifaces --> < string translatable="false" name="config_ethernet_iface_regex"> eth\\d< /string> < !-- If the mobile hotspot feature requires provisioning, a package name and class name can be provided to launch a supported application that provisions the devices. Example Usage: String[] appDetails = getStringArray(R.array.config_mobile_hotspot_provision_app); Intent intent = new Intent(Intent.ACTION_MAIN); intent.setClassName(appDetails[0], appDetails[1]); startActivityForResult(intent, 0); public void onActivityResult(int requestCode, int resultCode, Intent intent) { super.onActivityResult(requestCode, resultCode, intent); if (requestCode == 0) { if (resultCode == Activity.RESULT_OK) { //Mobile hotspot provisioning successful } else { //Mobile hotspot provisioning failed } } See src/com/android/settings/TetherSettings.java for more details. --> < !-- The first element is the package name and the second element is the class name of the provisioning app --> < string-array translatable="false" name="config_mobile_hotspot_provision_app"> < !-- < item> com.example.provisioning< /item> < item> com.example.provisioning.Activity< /item> --> < /string-array> < !-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering --> < !-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or < !== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH --> < integer-array translatable="false" name="config_tether_upstream_types"> < item> 1< /item> < item> 4< /item> < /integer-array> < !-- String containing the apn value for tethering.May be overriden by secure settings TETHER_DUN_APN.Value is a comma separated series of strings: "name,apn,proxy,port,username,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,auth,type" note that empty fields can be ommitted: "name,apn,,,,,,,,,310,260,,DUN" --> < string translatable="false" name="config_tether_apndata"> < /string> < !-- Boolean indicating whether the wifi chipset has dual frequency band support --> < bool translatable="false" name="config_wifi_dual_band_support"> false< /bool> < !-- Boolean indicating whether the wifi chipset has p2p support --> < bool translatable="false" name="config_wifi_p2p_support"> false< /bool> < !-- Device type information conforming to Annex B format in WiFi Direct specification. The default represents a dual-mode smartphone --> < string translatable="false" name="config_wifi_p2p_device_type"> 10-0050F204-5< /string> < !-- Boolean indicating whether the wifi chipset supports background scanning mechanism. This mechanism allows the host to remain in suspend state and the dongle to actively scan and wake the host when a configured SSID is detected by the dongle. This chipset capability can provide power savings when wifi needs to be always kept on. The driver commands needed to support the feature are BGSCAN-START and BGSCAN-STOP --> < bool translatable="false" name="config_wifi_background_scan_support"> false< /bool> < !-- Integer indicating wpa_supplicant scan interval in milliseconds --> < integer translatable="false" name="config_wifi_supplicant_scan_interval"> 15000< /integer> < !-- Integer indicating the framework scan interval in milliseconds. This is used in the scenario where the chipset does not support background scanning (config_wifi_background_scan_suport is false) to set up a periodic wake up scan so that the device can connect to a new access point on the move. A value of 0 means no periodic scans will be used in the framework. --> < integer translatable="false" name="config_wifi_framework_scan_interval"> 300000< /integer> < !-- Flag indicating whether the keyguard should be bypassed when the slider is open.This can be set or unset depending how easily the slider can be opened (for example, in a pocket or purse). --> < bool name="config_bypass_keyguard_if_slider_open"> true< /bool> < !-- Flag indicating whether the we should enable the automatic brightness in Settings. Software implementation will be used if config_hardware_auto_brightness_available is not set --> < bool name="config_automatic_brightness_available"> false< /bool> < !-- Don‘t name config resources like this.It should look like config_annoyDianne --> < bool name="config_annoy_dianne"> true< /bool> < !-- If this is true, the screen will come on when you unplug usb/power/whatever. --> < bool name="config_unplugTurnsOnScreen"> false< /bool> < !-- If this is true, the screen will fade off. --> < bool name="config_animateScreenLights"> true< /bool> < !-- XXXXXX END OF RESOURCES USING WRONG NAMING CONVENTION --> < !-- If true, the screen can be rotated via the accelerometer in all 4 rotations as the default behavior. --> < bool name="config_allowAllRotations"> false< /bool> < !-- If true, the direction rotation is applied to get to an application‘s requested orientation is reversed.Normally, the model is that landscape is clockwise from portrait; thus on a portrait device an app requesting landscape will cause a clockwise rotation, and on a landscape device an app requesting portrait will cause a counter-clockwise rotation.Setting true here reverses that logic. --> < bool name="config_reverseDefaultRotation"> false< /bool> < !-- The number of degrees to rotate the display when the keyboard is open. --> < integer name="config_lidOpenRotation"> 90< /integer> < !-- The number of degrees to rotate the display when the device is in a desk dock. A value of -1 means no change in orientation by default. --> < integer name="config_deskDockRotation"> -1< /integer> < !-- The number of degrees to rotate the display when the device is in a car dock. A value of -1 means no change in orientation by default. --> < integer name="config_carDockRotation"> -1< /integer> < !-- Control whether being in the desk dock (and powered) always keeps the screen on.By default it stays on when plugged in to AC.0 will not keep it on; or together 1 to stay on when plugged in to AC and 2 to stay on when plugged in to USB.(So 3 for both.) --> < integer name="config_deskDockKeepsScreenOn"> 1< /integer> < !-- Control whether being in the car dock (and powered) always keeps the screen on.By default it stays on when plugged in to AC.0 will not keep it on; or together 1 to stay on when plugged in to AC and 2 to stay on when plugged in to USB.(So 3 for both.) --> < integer name="config_carDockKeepsScreenOn"> 1< /integer> < !-- Control whether being in the desk dock should enable accelerometer based screen orientation.Note this should probably default to true like car dock, but we haven‘t had a chance to test it. --> < bool name="config_deskDockEnablesAccelerometer"> false< /bool> < !-- Control whether being in the car dock should enable accelerometer based screen orientation.This defaults to true because putting a device in a car dock make the accelerometer more a physical input (like a lid). --> < bool name="config_carDockEnablesAccelerometer"> true< /bool> < !-- Indicate whether the lid state impacts the accessibility of the physical keyboard.0 means it doesn‘t, 1 means it is accessible when the lid is open, 2 means it is accessible when the lid is closed.The default is 1. --> < integer name="config_lidKeyboardAccessibility"> 1< /integer> < !-- Indicate whether the lid state impacts the accessibility of the physical keyboard.0 means it doesn‘t, 1 means it is accessible when the lid is open, 2 means it is accessible when the lid is closed.The default is 0. --> < integer name="config_lidNavigationAccessibility"> 0< /integer> < !-- Control the behavior when the user long presses the power button. 0 - Nothing 1 - Global actions menu 2 - Power off (with confirmation) --> < integer name="config_longPressOnPowerBehavior"> 1< /integer> < !-- Indicate whether the SD card is accessible without removing the battery. --> < bool name="config_batterySdCardAccessibility"> false< /bool> < !-- List of file paths for USB host busses to exclude from USB host support. For example, if the first USB bus on the device is used to communicate with the modem or some other restricted hardware, add "/dev/bus/usb/001/" to this list.If this is empty, no parts of the host USB bus will be excluded. --> < string-array name="config_usbHostBlacklist"> < /string-array> < !-- Vibrator pattern for feedback about a long screen/key press --> < integer-array name="config_longPressVibePattern"> < item> 0< /item> < item> 1< /item> < item> 20< /item> < item> 21< /item> < /integer-array> < !-- Vibrator pattern for feedback about touching a virtual key --> < integer-array name="config_virtualKeyVibePattern"> < item> 0< /item> < item> 10< /item> < item> 20< /item> < item> 30< /item> < /integer-array> < !-- Vibrator pattern for a very short but reliable vibration for soft keyboard tap --> < integer-array name="config_keyboardTapVibePattern"> < item> 40< /item> < /integer-array> < !-- Vibrator pattern for feedback about booting with safe mode disabled --> < integer-array name="config_safeModeDisabledVibePattern"> < item> 0< /item> < item> 1< /item> < item> 20< /item> < item> 21< /item> < /integer-array> < !-- Vibrator pattern for feedback about booting with safe mode disabled --> < integer-array name="config_safeModeEnabledVibePattern"> < item> 0< /item> < item> 1< /item> < item> 20< /item> < item> 21< /item> < item> 500< /item> < item> 600< /item> < /integer-array> < !-- Vibrator pattern for feedback about hitting a scroll barrier --> < integer-array name="config_scrollBarrierVibePattern"> < item> 0< /item> < item> 15< /item> < item> 10< /item> < item> 10< /item> < /integer-array> < bool name="config_use_strict_phone_number_comparation"> false< /bool> < !-- Display low battery warning when battery level dips to this value. Also, the battery stats are flushed to disk when we hit this level.--> < integer name="config_criticalBatteryWarningLevel"> 4< /integer> < !-- Display low battery warning when battery level dips to this value --> < !-- Display low battery warning when battery level dips to this value --> < integer name="config_lowBatteryWarningLevel"> 15< /integer> < !-- Close low battery warning when battery level reaches this value --> < integer name="config_lowBatteryCloseWarningLevel"> 20< /integer> < !-- Default color for notification LED. --> < color name="config_defaultNotificationColor"> #ff00ff00< /color> < !-- Default LED on time for notification LED in milliseconds. --> < integer name="config_defaultNotificationLedOn"> 500< /integer> < !-- Default LED off time for notification LED in milliseconds. --> < integer name="config_defaultNotificationLedOff"> 2000< /integer> < !-- Default value for led color when battery is low on charge --> < integer name="config_notificationsBatteryLowARGB"> 0xFFFF0000< /integer> < !-- Default value for led color when battery is medium charged --> < integer name="config_notificationsBatteryMediumARGB"> 0xFFFFFF00< /integer> < !-- Default value for led color when battery is fully charged --> < integer name="config_notificationsBatteryFullARGB"> 0xFF00FF00< /integer> < !-- Default value for LED on time when the battery is low on charge in miliseconds --> < integer name="config_notificationsBatteryLedOn"> 125< /integer> < !-- Is the notification LED intrusive? Used to decide if there should be a disable option --> < bool name="config_intrusiveNotificationLed"> false< /bool> < !-- Default value for LED off time when the battery is low on charge in miliseconds --> < integer name="config_notificationsBatteryLedOff"> 2875< /integer> < !-- Allow the menu hard key to be disabled in LockScreen on some devices --> < bool name="config_disableMenuKeyInLockScreen"> false< /bool> < !-- Don‘t show lock screen before unlock screen (PIN/pattern/password) --> < bool name="config_enableLockBeforeUnlockScreen"> false< /bool> < !-- Diable lockscreen rotation by default --> < bool name="config_enableLockScreenRotation"> false< /bool> < !-- Enable puk unlockscreen by default. If unlock screen is disabled, the puk should be unlocked through Emergency Dialer --> < bool name="config_enable_puk_unlock_screen"> true< /bool> < !-- Enable emergency call when sim is locked or puk locked. Some countries/carriers do not allow emergency calls to be placed without the IMSI, which is locked in the SIM. If so, this should be set to ‘false‘ in an overlay. --> < bool name="config_enable_emergency_call_while_sim_locked"> true< /bool> < !-- Control the behavior when the user long presses the home button. 0 - Nothing 1 - Recent apps dialog 2 - Recent apps view in SystemUI This needs to match the constants in policy/src/com/android/internal/policy/impl/PhoneWindowManager.java --> < integer name="config_longPressOnHomeBehavior"> 2< /integer> < !-- Array of light sensor LUX values to define our levels for auto backlight brightness support. The N entries of this array define N + 1 zones as follows: Zone 0:0 < = LUX < array[0] Zone 1:array[0] < = LUX < array[1] ... Zone N:array[N - 1] < = LUX < array[N] Zone N + 1:array[N] < = LUX < infinity Must be overridden in platform specific overlays --> < integer-array name="config_autoBrightnessLevels"> < /integer-array> < !-- Minimum screen brightness allowed by the power manager. --> < integer name="config_screenBrightnessDim"> 20< /integer> < !-- Array of output values for LCD backlight corresponding to the LUX values in the config_autoBrightnessLevels array.This array should have size one greater than the size of the config_autoBrightnessLevels array. This must be overridden in platform specific overlays --> < integer-array name="config_autoBrightnessLcdBacklightValues"> < /integer-array> < !-- Array of output values for button backlight corresponding to the LUX values in the config_autoBrightnessLevels array.This array should have size one greater than the size of the config_autoBrightnessLevels array. This must be overridden in platform specific overlays --> < integer-array name="config_autoBrightnessButtonBacklightValues"> < /integer-array> < !-- Array of output values for keyboard backlight corresponding to the LUX values in the config_autoBrightnessLevels array.This array should have size one greater than the size of the config_autoBrightnessLevels array. This must be overridden in platform specific overlays --> < integer-array name="config_autoBrightnessKeyboardBacklightValues"> < /integer-array> < !-- Amount of time it takes for the light sensor to warm up in milliseconds. For this time after the screen turns on, the Power Manager will not debounce light sensor readings --> < integer name="config_lightSensorWarmupTime"> 0< /integer> < !-- Enables swipe versus poly-finger touch disambiguation in the KeyboardView --> < bool name="config_swipeDisambiguation"> true< /bool> < !-- Specifies the amount of time to disable virtual keys after the screen is touched in order to filter out accidental virtual key presses due to swiping gestures or taps near the edge of the display.May be 0 to disable the feature. It is recommended that this value be no more than 250 ms. This feature should be disabled for most devices. --> < integer name="config_virtualKeyQuietTimeMillis"> 0< /integer> < !-- Component name of the default wallpaper. This will be ImageWallpaper if not specified --> < string name="default_wallpaper_component"> @null< /string> < !-- Component name of the service providing network location support. --> < string name="config_networkLocationProvider"> @null< /string> < !-- Component name of the service providing geocoder API support. --> < string name="config_geocodeProvider"> @null< /string> < !-- Boolean indicating if current platform supports bluetooth SCO for off call use cases --> < bool name="config_bluetooth_sco_off_call"> true< /bool> < !-- Boolean indicating if current platform supports bluetooth wide band speech --> < bool name="config_bluetooth_wide_band_speech"> true< /bool> < !-- Boolean indicating if current platform supports quick switch-on/off of Bluetooth Module --> < bool name="config_bluetooth_adapter_quick_switch"> true< /bool> < !-- The default data-use polling period. --> < integer name="config_datause_polling_period_sec"> 600< /integer> < !-- The default data-use threshold in bytes. 0 disables--> < integer name="config_datause_threshold_bytes"> 0< /integer> < !-- The default reduced-datarate value in kilobits per sec --> < integer name="config_datause_throttle_kbitsps"> 300< /integer> < !-- The default iface on which to monitor data use --> < string name="config_datause_iface"> rmnet0< /string> < !-- The default reduced-datarate notification mask --> < !-- 2 means give warning --> < integer name="config_datause_notification_type"> 2< /integer> < !-- Flag indicating whether the current device is "voice capable". If true, this means that the device supports circuit-switched (i.e. voice) phone calls over the telephony network, and is allowed to display the in-call UI while a cellular voice call is active.This can be overridden to false for "data only" devices which can‘t make voice calls and don‘t support any in-call UI. Note: this flag is subtly different from the PackageManager.FEATURE_TELEPHONY system feature, which is available on *any* device with a telephony radio, even if the device is data-only. --> < bool name="config_voice_capable"> true< /bool> < !-- Flag indicating whether the current device allows sms service. If true, this means that the device supports both sending and receiving sms via the telephony network. This can be overridden to false for "data only" devices which can‘t send and receive sms message. Note: Disable SMS also disable voicemail waiting sms, cell broadcasting sms, and MMS. --> < bool name="config_sms_capable"> true< /bool> < !-- IP address of the dns server to use if nobody else suggests one --> < string name="config_default_dns_server"> 8.8.8.8< /string> < !-- The default character set for GsmAlphabet --> < !-- Empty string means MBCS is not considered --> < string name="gsm_alphabet_default_charset"> < /string> < !-- Enables SIP on WIFI only --> < bool name="config_sip_wifi_only"> false< /bool> < !-- Enables built-in SIP phone capability --> < bool name="config_built_in_sip_phone"> true< /bool> < !-- Boolean indicating if restoring network selection should be skipped --> < !-- The restoring is handled by modem if it is true--> < bool translatable="false" name="skip_restoring_network_selection"> false< /bool> < !-- Number of database connections opened and managed by framework layer to handle queries on each database. --> < integer name="db_connection_pool_size"> 1< /integer> < !-- Max space (in MB) allocated to DownloadManager to store the downloaded files if they are to be stored in DownloadManager‘s data dir, which typically is /data/data/com.android.providers.downloads/files --> < integer name="config_downloadDataDirSize"> 100< /integer> < !-- Max number of downloads allowed to proceed concurrently --> < integer name="config_MaxConcurrentDownloadsAllowed"> 5< /integer> < !-- When the free space available in DownloadManager‘s data dir falls below the percentage value specified by this param, DownloadManager starts removing files to try to make percentage of available free space above this threshold value. --> < integer name="config_downloadDataDirLowSpaceThreshold"> 10< /integer> < !-- The URL that should be sent in an x-wap-profile header with an HTTP request, as defined in the Open Mobile Alliance User Agent Profile specification OMA-TS-UAProf-V2_0-20060206-A Section 8.1.1.1. If the URL contains a ‘%s‘ format string then that substring will be replaced with the value of Build.MODEL. The format string shall not be escaped. --> < string name="config_useragentprofile_url"> < /string> < !-- When a database query is executed, the results retuned are paginated in pages of size (in KB) indicated by this value --> < integer name="config_cursorWindowSize"> 2048< /integer> < !-- Sets whether menu shortcuts should be displayed on panel menus when a keyboard is present. --> < bool name="config_showMenuShortcutsWhenKeyboardPresent"> false< /bool> < !-- Do not translate. Defines the slots is Two Digit Number for dialing normally not USSD --> < string-array name="config_twoDigitNumberPattern"> < /string-array> < !-- The VoiceMail default value is displayed to my own number if it is true --> < bool name="config_telephony_use_own_number_for_voicemail"> false< /bool> < !-- If this value is true, Sms encoded as octet is decoded by utf8 decoder. If false, decoded by Latin decoder. --> < bool name="config_sms_utf8_support"> false< /bool> < !-- If this value is true, The mms content-disposition field is supported correctly. If false, Content-disposition fragments are ignored --> < bool name="config_mms_content_disposition_support"> true< /bool> < !-- National Language Identifier codes for the following two config items. (from 3GPP TS 23.038 V9.1.1 Table 6.2.1.2.4.1): 0- reserved 1- Turkish 2- Spanish (single shift table only) 3- Portuguese 4- Bengali 5- Gujarati 6- Hindi 7- Kannada 8- Malayalam 9- Oriya 10- Punjabi 11- Tamil 12- Telugu 13- Urdu 14+ - reserved --> < !-- National language single shift tables to enable for SMS encoding. Decoding is always enabled. 3GPP TS 23.038 states that this feature should not be enabled until a formal request is issued by the relevant national regulatory body. Array elements are codes from the table above. Example 1: devices sold in Turkey must include table 1 to conform with By-Law Number 27230. (http://www.btk.gov.tr/eng/pdf/2009/BY-LAW_SMS.pdf) Example 2: devices sold in India should include tables 4 through 13 to enable use of the new Release 9 tables for Indic languages. --> < integer-array name="config_sms_enabled_single_shift_tables"> < /integer-array> < !-- National language locking shift tables to enable for SMS encoding. Decoding is always enabled. 3GPP TS 23.038 states that this feature should not be enabled until a formal request is issued by the relevant national regulatory body. Array elements are codes from the table above. Example 1: devices sold in Turkey must include table 1 after the Turkish Telecommunication Authority requires locking shift encoding to be enabled (est. July 2012). (http://www.btk.gov.tr/eng/pdf/2009/BY-LAW_SMS.pdf) See also: http://www.mobitech.com.tr/tr/ersanozturkblog_en/index.php?entry=entry090223-160014 Example 2: devices sold in India should include tables 4 through 13 to enable use of the new Release 9 tables for Indic languages. --> < integer-array name="config_sms_enabled_locking_shift_tables"> < /integer-array> < !-- Set to true if the RSSI should always display CDMA signal strength even on EVDO --> < bool name="config_alwaysUseCdmaRssi"> false< /bool> < !-- If this value is true, duplicate Source/Destination port fields in WDP header of some carriers OMADM wap push are supported. ex: MSGTYPE-TotalSegments-CurrentSegment -SourcePortDestPort-SourcePortDestPort-OMADM PDU If false, not supported. --> < bool name="config_duplicate_port_omadm_wappush"> false< /bool> < !-- Maximum numerical value that will be shown in a status bar notification icon or in the notification itself. Will be replaced with @string/status_bar_notification_info_overflow when shown in the UI. --> < integer name="status_bar_notification_info_maxnum"> 999< /integer> < !-- Path to an ISO image to be shared with via USB mass storage. This is intended to allow packaging drivers or tools for installation on a PC. --> < string translatable="false" name="config_isoImagePath"> < /string> < !-- Whether a software navigation bar should be shown. NOTE: in the future this may be autodetected from the Configuration. --> < bool name="config_showNavigationBar"> false< /bool> < !-- Whether action menu items should be displayed in ALLCAPS or not. Defaults to true. If this is not appropriate for specific locales it should be disabled in that locale‘s resources. --> < bool name="config_actionMenuItemAllCaps"> true< /bool> < !-- Whether action menu items should obey the "withText" showAsAction flag. This may be set to false for situations where space is extremely limited. --> < bool name="config_allowActionMenuItemTextWithIcon"> false< /bool> < !-- Remote server that can provide NTP responses. --> < string translatable="false" name="config_ntpServer"> pool.ntp.org< /string> < !-- Timeout to wait for NTP server response. --> < integer name="config_ntpTimeout"> 20000< /integer> < !-- Default network policy warning threshold, in megabytes. --> < integer name="config_networkPolicyDefaultWarning"> 2048< /integer> < !-- Set and Unsets WiMAX --> < bool name="config_wimaxEnabled"> false< /bool> < !-- Location of the wimax framwork jar location --> < string name="config_wimaxServiceJarLocation"> < /string> < !-- Location of the wimax native library locaiton --> < string name="config_wimaxNativeLibLocation"> < /string> < !-- Name of the wimax manager class --> < string name="config_wimaxManagerClassname"> < /string> < !-- Name of the wimax service class --> < string name="config_wimaxServiceClassname"> < /string> < !-- Name of the wimax state tracker clas --> < string name="config_wimaxStateTrackerClassname"> < /string> < !-- Base "touch slop" value used by ViewConfiguration as a movement threshold where scrolling should begin. --> < dimen name="config_viewConfigurationTouchSlop"> 8dp< /dimen> < /resources>
这些配置项可以使用下述类似的方式获取:
DEBUG = MyApplication.getInstance().getResources() .getBoolean(R.bool.debug);
从上述文件内容可以看出,config.xml文件中保存和定义内容的类型是可以不同的,可以是整型的,也可以是字符串类型的等等。
YOcSetting应用程序代码中定义的config.xml文件:
< ?xml version="1.0" encoding="utf-8"?> < resources> < !-- 异常捕获的log日志开关 --> < bool name="uncaught_log_switch"> true< /bool> < !-- 异常捕获的log日志开关 --> < bool name="debug"> true< /bool> < !-- 碰撞等级的开关 --> < bool name="default_collision"> false< /bool> < integer name="default_collision_level"> 0< /integer> < string name="default_collision_level"> 8< /string> < string name="default_collision_sensitive"> 205< /string> < !-- FM打开默认的频率值 --> < string name="default_fm_hz"> 10800< /string> < !-- FM默认为关闭 --> < string name="default_fm_switch"> 0< /string> < !-- 1:云知声,2:同行者 --> < integer name="voice_tts_type"> 1< /integer> < !-- FM打开的时候,系统媒体音乐为12 --> < integer name="fmon_system_max_volumn"> 12< /integer> < integer name="settings_system_max_volumn"> 15< /integer> < string name="default_navi"> com.autonavi.minimap< /string> < /resources>
推荐阅读
- Android数据存储引擎---SQLite数据库
- Android学习笔记(十三) Handler
- Android学习笔记 Intent
- Android(PowerManager类 电源管理)
- Android开发(《Gradle Recipes for Android》阅读笔记(翻译)3.1——使用Build Types)
- Android学习笔记 Activity的生命周期
- Android(或者Java)通过HttpUrlConnection向SpringMVC请求数据(数据绑定)
- 埃森哲面试体验(校园内)
- 算法题(递归程序打印三角形图案)