11

There are 3 inner classes in android.provider.Settings:

  1. Global
  2. System
  3. Secure

Each class has a different type of Preference. Can someone explain the role/scope of each of these classes?

ross
  • 2,684
  • 2
  • 13
  • 22
ajay
  • 477
  • 6
  • 14

3 Answers3

5

From the Android developer docs:

  • Settings.System : System settings, containing miscellaneous system preferences. This table holds simple name/value pairs. There are convenience functions for accessing individual settings entries.
  • Settings.Secure : Secure system settings, containing system preferences that applications can read but are not allowed to write. These are for preferences that the user must explicitly modify through the system UI or specialized APIs for those values, not modified directly by applications.
  • 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
Will Sheppard
  • 3,272
  • 2
  • 31
  • 41
3

Settings.Global was introduced in API 17, and now contains some values that were previously stored in Settings.System.

e.g. prior to API 17, the Device Name was stored in Settings.System, and now it is stored in Settings.Global.

(see related post for info on that: Android : Get “device name” on android tv)

Richard Le Mesurier
  • 29,432
  • 22
  • 140
  • 255
1

Settings.Secure is same like Settings.Global Both are can be modified only by Settings apps or SystemUI app and other apps can read them Only difference is that Global will be applied to all users

On the other hand Settings.System can be modified by apps that uses dynamic preferences or other system apps