Settings.Global
public
static
final
class
Settings.Global
extends Settings.NameValueTable
java.lang.Object | ||
↳ | android.provider.Settings.NameValueTable | |
↳ | android.provider.Settings.Global |
Global system settings, containing preferences that always apply identically to all defined users. Applications can read these but are not allowed to write; like the "Secure" settings, these are for preferences that the user must explicitly modify through the system UI or specialized APIs for those values.
Summary
Constants | |
---|---|
String |
ADB_ENABLED
Whether ADB over USB is enabled. |
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 |
ALWAYS_FINISH_ACTIVITIES
If not 0, the activity manager will aggressively finish activities and processes as soon as they are no longer needed. |
String |
ANIMATOR_DURATION_SCALE
Scaling factor for Animator-based animations. |
String |
APPLY_RAMPING_RINGER
This constant was deprecated
in API level 33.
Use |
String |
AUTO_TIME
Value to specify if the device's UTC system clock should be set automatically, e.g. using telephony signals like NITZ, or other sources like GNSS or NTP. |
String |
AUTO_TIME_ZONE
Value to specify if the device's time zone system property should be set automatically, e.g. using telephony signals like MCC and NITZ, or other mechanisms like the location. |
String |
BLUETOOTH_ON
Whether bluetooth is enabled/disabled 0=disabled. |
String |
BOOT_COUNT
Boot count since the device starts running API level 24. |
String |
CONTACT_METADATA_SYNC_ENABLED
Whether to enable contacts metadata syncing or not The value 1 - enable, 0 - disable |
String |
DATA_ROAMING
Whether or not data roaming is enabled. |
String |
DEBUG_APP
Name of an application package to be debugged. |
String |
DEVELOPMENT_SETTINGS_ENABLED
Whether user has enabled development settings. |
String |
DEVICE_NAME
The name of the device |
String |
DEVICE_PROVISIONED
Whether the device has been provisioned (0 = false, 1 = true). |
String |
HTTP_PROXY
Host name and port for global http proxy. |
String |
INSTALL_NON_MARKET_APPS
This constant was deprecated
in API level 21.
Use |
String |
MODE_RINGER
Ringer mode. |
String |
NETWORK_PREFERENCE
User preference for which network(s) should be used. |
String |
RADIO_BLUETOOTH
Constant for use in AIRPLANE_MODE_RADIOS or SATELLITE_MODE_RADIOS to specify Bluetooth radio. |
String |
RADIO_CELL
Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio. |
String |
RADIO_NFC
Constant for use in AIRPLANE_MODE_RADIOS or SATELLITE_MODE_RADIOS to specify NFC radio. |
String |
RADIO_WIFI
Constant for use in AIRPLANE_MODE_RADIOS or SATELLITE_MODE_RADIOS to specify Wi-Fi radio. |
String |
SECURE_FRP_MODE
Indicates whether the device is under restricted secure FRP mode. |
String |
SHOW_PROCESSES
This constant was deprecated
in API level 25.
This functionality is no longer available as of
|
String |
STAY_ON_WHILE_PLUGGED_IN
Whether we keep the device on while the device is plugged in. |
String |
TRANSITION_ANIMATION_SCALE
Scaling factor for activity transition animations. |
String |
USB_MASS_STORAGE_ENABLED
USB Mass Storage Enabled |
String |
USE_GOOGLE_MAIL
If this setting is set (to anything), then all references to Gmail on the device must change to Google Mail. |
String |
WAIT_FOR_DEBUGGER
If 1, when launching DEBUG_APP it will wait for the debugger before starting user code. |
String |
WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN
This setting controls whether WiFi configurations created by a Device Owner app should be locked down (that is, be editable or removable only by the Device Owner App, not even by Settings app). |
String |
WIFI_MAX_DHCP_RETRY_COUNT
The maximum number of times we will retry a connection to an access point for which we have failed in acquiring an IP address from DHCP. |
String |
WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS
Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile data connectivity to be established after a disconnect from Wi-Fi. |
String |
WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON
This constant was deprecated
in API level 26.
This feature is no longer controlled by this setting in
|
String |
WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY
This constant was deprecated in API level 30. This is no longer used or set by the platform. |
String |
WIFI_NUM_OPEN_NETWORKS_KEPT
This constant was deprecated in API level 30. This is no longer used or set by the platform. |
String |
WIFI_ON
Whether the Wi-Fi should be on. |
String |
WIFI_SLEEP_POLICY
This constant was deprecated in API level 30. This is no longer used or set by the platform. |
int |
WIFI_SLEEP_POLICY_DEFAULT
This constant was deprecated in API level 30. This is no longer used by the platform. |
int |
WIFI_SLEEP_POLICY_NEVER
This constant was deprecated in API level 30. This is no longer used by the platform. |
int |
WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED
This constant was deprecated in API level 30. This is no longer used by the platform. |
String |
WIFI_WATCHDOG_ON
Whether the Wi-Fi watchdog is enabled. |
String |
WINDOW_ANIMATION_SCALE
Scaling factor for normal window animations. |
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Uri |
CONTENT_URI
The content:// style URL for global secure settings items. |
Public constructors | |
---|---|
Global()
|
Public methods | |
---|---|
static
float
|
getFloat(ContentResolver cr, String name, float def)
Convenience function for retrieving a single secure settings value as a floating point number. |
static
float
|
getFloat(ContentResolver cr, String name)
Convenience function for retrieving a single secure settings value as a float. |
static
int
|
getInt(ContentResolver cr, String name)
Convenience function for retrieving a single secure settings value as an integer. |
static
int
|
getInt(ContentResolver cr, String name, int def)
Convenience function for retrieving a single secure settings value as an integer. |
static
long
|
getLong(ContentResolver cr, String name)
Convenience function for retrieving a single secure settings value
as a |
static
long
|
getLong(ContentResolver cr, String name, long def)
Convenience function for retrieving a single secure settings value
as a |
static
String
|
getString(ContentResolver resolver, String name)
Look up a name in the database. |
static
Uri
|
getUriFor(String name)
Construct the content URI for a particular name/value pair, useful for monitoring changes with a ContentObserver. |
static
boolean
|
putFloat(ContentResolver cr, String name, float value)
Convenience function for updating a single settings value as a floating point number. |
static
boolean
|
putInt(ContentResolver cr, String name, int value)
Convenience function for updating a single settings value as an integer. |
static
boolean
|
putLong(ContentResolver cr, String name, long value)
Convenience function for updating a secure settings value as a long integer. |
static
boolean
|
putString(ContentResolver resolver, String name, String value)
Store a name/value pair into the database. |
Inherited methods | |
---|---|
Constants
ADB_ENABLED
public static final String ADB_ENABLED
Whether ADB over USB is enabled.
Constant Value: "adb_enabled"
AIRPLANE_MODE_ON
public static final String AIRPLANE_MODE_ON
Whether Airplane Mode is on.
Constant Value: "airplane_mode_on"
AIRPLANE_MODE_RADIOS
public static final String AIRPLANE_MODE_RADIOS
A comma separated list of radios that need to be disabled when airplane mode is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are included in the comma separated list.
Constant Value: "airplane_mode_radios"
ALWAYS_FINISH_ACTIVITIES
public static final String ALWAYS_FINISH_ACTIVITIES
If not 0, the activity manager will aggressively finish activities and processes as soon as they are no longer needed. If 0, the normal extended lifetime is used.
Constant Value: "always_finish_activities"
ANIMATOR_DURATION_SCALE
public static final String ANIMATOR_DURATION_SCALE
Scaling factor for Animator-based animations. This affects both the start delay and duration of all such animations. The value is a float. Setting to 0.0f will cause animations to end immediately. The default value is 1.0f.
Constant Value: "animator_duration_scale"
APPLY_RAMPING_RINGER
public static final String APPLY_RAMPING_RINGER
This constant was deprecated
in API level 33.
Use AudioManager#isRampingRingerEnabled()
instead
Whether applying ramping ringer on incoming phone call ringtone.
1 = apply ramping ringer
0 = do not apply ramping ringer
Constant Value: "apply_ramping_ringer"
AUTO_TIME
public static final String AUTO_TIME
Value to specify if the device's UTC system clock should be set automatically, e.g. using telephony signals like NITZ, or other sources like GNSS or NTP.
Prefer android.app.time.TimeManager
API calls to determine the state of
automatic time detection instead of directly observing this setting as it may be ignored
by the time_detector service under various conditions.
1=yes, 0=no (manual)
Constant Value: "auto_time"
AUTO_TIME_ZONE
public static final String AUTO_TIME_ZONE
Value to specify if the device's time zone system property should be set automatically, e.g. using telephony signals like MCC and NITZ, or other mechanisms like the location.
Prefer android.app.time.TimeManager
API calls to determine the state of
automatic time zone detection instead of directly observing this setting as it may be
ignored by the time_zone_detector service under various conditions.
1=yes, 0=no (manual).
Constant Value: "auto_time_zone"
BLUETOOTH_ON
public static final String BLUETOOTH_ON
Whether bluetooth is enabled/disabled 0=disabled. 1=enabled.
Constant Value: "bluetooth_on"
BOOT_COUNT
public static final String BOOT_COUNT
Boot count since the device starts running API level 24.
Type: int
Constant Value: "boot_count"
CONTACT_METADATA_SYNC_ENABLED
public static final String CONTACT_METADATA_SYNC_ENABLED
Whether to enable contacts metadata syncing or not The value 1 - enable, 0 - disable
Constant Value: "contact_metadata_sync_enabled"
DATA_ROAMING
public static final String DATA_ROAMING
Whether or not data roaming is enabled. (0 = false, 1 = true)
Use TelephonyManager#isDataRoamingEnabled
instead of calling via settings.
Constant Value: "data_roaming"
DEBUG_APP
public static final String DEBUG_APP
Name of an application package to be debugged.
Constant Value: "debug_app"
DEVELOPMENT_SETTINGS_ENABLED
public static final String DEVELOPMENT_SETTINGS_ENABLED
Whether user has enabled development settings.
Constant Value: "development_settings_enabled"
DEVICE_NAME
public static final String DEVICE_NAME
The name of the device
Constant Value: "device_name"
DEVICE_PROVISIONED
public static final String DEVICE_PROVISIONED
Whether the device has been provisioned (0 = false, 1 = true).
On a multiuser device with a separate system user, the screen may be locked as soon as this is set to true and further activities cannot be launched on the system user unless they are marked to show over keyguard.
Constant Value: "device_provisioned"
HTTP_PROXY
public static final String HTTP_PROXY
Host name and port for global http proxy. Uses ':' seperator for between host and port.
Constant Value: "http_proxy"
INSTALL_NON_MARKET_APPS
public static final String INSTALL_NON_MARKET_APPS
This constant was deprecated
in API level 21.
Use Settings.Secure.INSTALL_NON_MARKET_APPS
instead
Constant Value: "install_non_market_apps"
MODE_RINGER
public static final String MODE_RINGER
Ringer mode. This is used internally, changing this value will not change the ringer mode. See AudioManager.
Constant Value: "mode_ringer"
NETWORK_PREFERENCE
public static final String NETWORK_PREFERENCE
User preference for which network(s) should be used. Only the connectivity service should touch this.
Constant Value: "network_preference"
RADIO_BLUETOOTH
public static final String RADIO_BLUETOOTH
Constant for use in AIRPLANE_MODE_RADIOS or SATELLITE_MODE_RADIOS to specify Bluetooth radio.
Constant Value: "bluetooth"
RADIO_CELL
public static final String RADIO_CELL
Constant for use in AIRPLANE_MODE_RADIOS to specify Cellular radio.
Constant Value: "cell"
RADIO_NFC
public static final String RADIO_NFC
Constant for use in AIRPLANE_MODE_RADIOS or SATELLITE_MODE_RADIOS to specify NFC radio.
Constant Value: "nfc"
RADIO_WIFI
public static final String RADIO_WIFI
Constant for use in AIRPLANE_MODE_RADIOS or SATELLITE_MODE_RADIOS to specify Wi-Fi radio.
Constant Value: "wifi"
SECURE_FRP_MODE
public static final String SECURE_FRP_MODE
Indicates whether the device is under restricted secure FRP mode. Secure FRP mode is enabled when the device is under FRP. On solving of FRP challenge, device is removed from this mode.
Type: int (0 for false, 1 for true)
Constant Value: "secure_frp_mode"
SHOW_PROCESSES
public static final String SHOW_PROCESSES
This constant was deprecated
in API level 25.
This functionality is no longer available as of
Build.VERSION_CODES.N_MR1
.
Control whether the process CPU usage meter should be shown.
Constant Value: "show_processes"
STAY_ON_WHILE_PLUGGED_IN
public static final String STAY_ON_WHILE_PLUGGED_IN
Whether we keep the device on while the device is plugged in. Supported values are:
0
to never stay on while plugged inBatteryManager#BATTERY_PLUGGED_AC
to stay on for AC chargerBatteryManager#BATTERY_PLUGGED_USB
to stay on for USB chargerBatteryManager#BATTERY_PLUGGED_WIRELESS
to stay on for wireless chargerBatteryManager#BATTERY_PLUGGED_DOCK
to stay on for dock charger
Constant Value: "stay_on_while_plugged_in"
TRANSITION_ANIMATION_SCALE
public static final String TRANSITION_ANIMATION_SCALE
Scaling factor for activity transition animations. The value is a float. Setting to 0.0f will disable window animations.
Constant Value: "transition_animation_scale"
USB_MASS_STORAGE_ENABLED
public static final String USB_MASS_STORAGE_ENABLED
USB Mass Storage Enabled
Constant Value: "usb_mass_storage_enabled"
USE_GOOGLE_MAIL
public static final String USE_GOOGLE_MAIL
If this setting is set (to anything), then all references to Gmail on the device must change to Google Mail.
Constant Value: "use_google_mail"
WAIT_FOR_DEBUGGER
public static final String WAIT_FOR_DEBUGGER
If 1, when launching DEBUG_APP it will wait for the debugger before starting user code. If 0, it will run normally.
Constant Value: "wait_for_debugger"
WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN
public static final String WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN
This setting controls whether WiFi configurations created by a Device Owner app should be locked down (that is, be editable or removable only by the Device Owner App, not even by Settings app). This setting takes integer values. Non-zero values mean DO created configurations are locked down. Value of zero means they are not. Default value in the absence of actual value to this setting is 0.
Constant Value: "wifi_device_owner_configs_lockdown"
WIFI_MAX_DHCP_RETRY_COUNT
public static final String WIFI_MAX_DHCP_RETRY_COUNT
The maximum number of times we will retry a connection to an access point for which we have failed in acquiring an IP address from DHCP. A value of N means that we will make N+1 connection attempts in all.
Constant Value: "wifi_max_dhcp_retry_count"
WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS
public static final String WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS
Maximum amount of time in milliseconds to hold a wakelock while waiting for mobile data connectivity to be established after a disconnect from Wi-Fi.
Constant Value: "wifi_mobile_data_transition_wakelock_timeout_ms"
WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON
public static final String WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON
This constant was deprecated
in API level 26.
This feature is no longer controlled by this setting in
Build.VERSION_CODES.O
.
Whether to notify the user of open networks.
If not connected and the scan results have an open network, we will
put this notification up. If we attempt to connect to a network or
the open network(s) disappear, we remove the notification. When we
show the notification, we will not show it again for
Settings.Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY
time.
Constant Value: "wifi_networks_available_notification_on"
WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY
public static final String WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY
This constant was deprecated
in API level 30.
This is no longer used or set by the platform.
Delay (in seconds) before repeating the Wi-Fi networks available notification. Connecting to a network will reset the timer.
Constant Value: "wifi_networks_available_repeat_delay"
WIFI_NUM_OPEN_NETWORKS_KEPT
public static final String WIFI_NUM_OPEN_NETWORKS_KEPT
This constant was deprecated
in API level 30.
This is no longer used or set by the platform.
When the number of open networks exceeds this number, the least-recently-used excess networks will be removed.
Constant Value: "wifi_num_open_networks_kept"
WIFI_ON
public static final String WIFI_ON
Whether the Wi-Fi should be on. Only the Wi-Fi service should touch this.
Constant Value: "wifi_on"
WIFI_SLEEP_POLICY
public static final String WIFI_SLEEP_POLICY
This constant was deprecated
in API level 30.
This is no longer used or set by the platform.
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).
Set to one of WIFI_SLEEP_POLICY_DEFAULT
,
WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED
, or
WIFI_SLEEP_POLICY_NEVER
.
Constant Value: "wifi_sleep_policy"
WIFI_SLEEP_POLICY_DEFAULT
public static final int WIFI_SLEEP_POLICY_DEFAULT
This constant was deprecated
in API level 30.
This is no longer used by the platform.
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.
Constant Value: 0 (0x00000000)
WIFI_SLEEP_POLICY_NEVER
public static final int WIFI_SLEEP_POLICY_NEVER
This constant was deprecated
in API level 30.
This is no longer used by the platform.
Value for WIFI_SLEEP_POLICY
to never go to sleep.
Constant Value: 2 (0x00000002)
WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED
public static final int WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED
This constant was deprecated
in API level 30.
This is no longer used by the platform.
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.
Constant Value: 1 (0x00000001)
WIFI_WATCHDOG_ON
public static final String WIFI_WATCHDOG_ON
Whether the Wi-Fi watchdog is enabled.
Constant Value: "wifi_watchdog_on"
WINDOW_ANIMATION_SCALE
public static final String WINDOW_ANIMATION_SCALE
Scaling factor for normal window animations. The value is a float. Setting to 0.0f will disable window animations.
Constant Value: "window_animation_scale"
Fields
CONTENT_URI
public static final Uri CONTENT_URI
The content:// style URL for global secure settings items. Not public.
Public constructors
Global
public Global ()
Public methods
getFloat
public static float getFloat (ContentResolver cr, String name, float def)
Convenience function for retrieving a single secure settings value as a floating point number. Note that internally setting values are always stored as strings; this function converts the string to an float for you. The default value will be returned if the setting is not defined or not a valid float.
Parameters | |
---|---|
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
def |
float : Value to return if the setting is not defined. |
Returns | |
---|---|
float |
The setting's current value, or 'def' if it is not defined or not a valid float. |
getFloat
public static float getFloat (ContentResolver cr, String name)
Convenience function for retrieving a single secure settings value as a float. Note that internally setting values are always stored as strings; this function converts the string to a float for you.
This version does not take a default value. If the setting has not
been set, or the string value is not a number,
it throws SettingNotFoundException
.
Parameters | |
---|---|
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
Returns | |
---|---|
float |
The setting's current value. |
Throws | |
---|---|
Settings.SettingNotFoundException |
Thrown if a setting by the given name can't be found or the setting value is not a float. |
getInt
public static int getInt (ContentResolver cr, String name)
Convenience function for retrieving a single secure settings value as an integer. Note that internally setting values are always stored as strings; this function converts the string to an integer for you.
This version does not take a default value. If the setting has not
been set, or the string value is not a number,
it throws SettingNotFoundException
.
Parameters | |
---|---|
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
Returns | |
---|---|
int |
The setting's current value. |
Throws | |
---|---|
Settings.SettingNotFoundException |
Thrown if a setting by the given name can't be found or the setting value is not an integer. |
getInt
public static int getInt (ContentResolver cr, String name, int def)
Convenience function for retrieving a single secure settings value as an integer. Note that internally setting values are always stored as strings; this function converts the string to an integer for you. The default value will be returned if the setting is not defined or not an integer.
Parameters | |
---|---|
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
def |
int : Value to return if the setting is not defined. |
Returns | |
---|---|
int |
The setting's current value, or 'def' if it is not defined or not a valid integer. |
getLong
public static long getLong (ContentResolver cr, String name)
Convenience function for retrieving a single secure settings value
as a long
. Note that internally setting values are always
stored as strings; this function converts the string to a long
for you.
This version does not take a default value. If the setting has not
been set, or the string value is not a number,
it throws SettingNotFoundException
.
Parameters | |
---|---|
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
Returns | |
---|---|
long |
The setting's current value. |
Throws | |
---|---|
Settings.SettingNotFoundException |
Thrown if a setting by the given name can't be found or the setting value is not an integer. |
getLong
public static long getLong (ContentResolver cr, String name, long def)
Convenience function for retrieving a single secure settings value
as a long
. Note that internally setting values are always
stored as strings; this function converts the string to a long
for you. The default value will be returned if the setting is
not defined or not a long
.
Parameters | |
---|---|
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to retrieve. |
def |
long : Value to return if the setting is not defined. |
Returns | |
---|---|
long |
The setting's current value, or 'def' if it is not defined
or not a valid long . |
getString
public static String getString (ContentResolver resolver, String name)
Look up a name in the database.
Parameters | |
---|---|
resolver |
ContentResolver : to access the database with |
name |
String : to look up in the table |
Returns | |
---|---|
String |
the corresponding value, or null if not present |
getUriFor
public static Uri getUriFor (String name)
Construct the content URI for a particular name/value pair, useful for monitoring changes with a ContentObserver.
Parameters | |
---|---|
name |
String : to look up in the table |
Returns | |
---|---|
Uri |
the corresponding content URI, or null if not present |
putFloat
public static boolean putFloat (ContentResolver cr, String name, float value)
Convenience function for updating a single settings value as a floating point number. This will either create a new entry in the table if the given name does not exist, or modify the value of the existing row with that name. Note that internally setting values are always stored as strings, so this function converts the given value to a string before storing it.
Parameters | |
---|---|
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to modify. |
value |
float : The new value for the setting. |
Returns | |
---|---|
boolean |
true if the value was set, false on database errors |
putInt
public static boolean putInt (ContentResolver cr, String name, int value)
Convenience function for updating a single settings value as an integer. This will either create a new entry in the table if the given name does not exist, or modify the value of the existing row with that name. Note that internally setting values are always stored as strings, so this function converts the given value to a string before storing it.
Parameters | |
---|---|
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to modify. |
value |
int : The new value for the setting. |
Returns | |
---|---|
boolean |
true if the value was set, false on database errors |
putLong
public static boolean putLong (ContentResolver cr, String name, long value)
Convenience function for updating a secure settings value as a long integer. This will either create a new entry in the table if the given name does not exist, or modify the value of the existing row with that name. Note that internally setting values are always stored as strings, so this function converts the given value to a string before storing it.
Parameters | |
---|---|
cr |
ContentResolver : The ContentResolver to access. |
name |
String : The name of the setting to modify. |
value |
long : The new value for the setting. |
Returns | |
---|---|
boolean |
true if the value was set, false on database errors |
putString
public static boolean putString (ContentResolver resolver, String name, String value)
Store a name/value pair into the database.
Parameters | |
---|---|
resolver |
ContentResolver : to access the database with |
name |
String : to store |
value |
String : to associate with the name |
Returns | |
---|---|
boolean |
true if the value was set, false on database errors |