Where are shared preferences stored?

farm ostrich picture farm ostrich · May 27, 2011 · Viewed 154k times · Source

Where in an Eclipse project might one encounter a shared preferences file?

Answer

Aleadam picture Aleadam · May 27, 2011

SharedPreferences are stored in an xml file in the app data folder, i.e.

/data/data/YOUR_PACKAGE_NAME/shared_prefs/YOUR_PREFS_NAME.xml

or the default preferences at:

/data/data/YOUR_PACKAGE_NAME/shared_prefs/YOUR_PACKAGE_NAME_preferences.xml

SharedPreferences added during runtime are not stored in the Eclipse project.

Note: Accessing /data/data/<package_name> requires superuser privileges