Deva
Deva

Reputation: 3949

SharedPreferences : Why are they called so?

As per my understanding the values stored using the SharedPreferences in android can be used only by the app which created it.(correct me if wrong).

Then what is the significance of the name SharedPreferences.

Is something really shared here?

Upvotes: 4

Views: 282

Answers (2)

DArkO
DArkO

Reputation: 16120

well it can be shared accross applications if you set the mode to WORLD READABLE or WORLD_WRITEABLE. (think ringtone settings, notification message etc...)

see this link

public static final int MODE_WORLD_READABLE
Since: API Level 1

File creation mode: allow all other applications to have read access to 
the created file.

Upvotes: 4

NoBugs
NoBugs

Reputation: 9512

The SharedPreferences use a secure /data directory for preferences that are shared within your app's activities and services.

http://developer.android.com/reference/android/content/SharedPreferences.html

Upvotes: 1

Related Questions