开发者

SharedPreferences : Why are they called so?

开发者 https://www.devze.com 2023-03-22 17:50 出处:网络
As per my understanding the values stored using the SharedPreferences in an开发者_JS百科droid can be used only by the app which created it.(correct me if wrong).

As per my understanding the values stored using the SharedPreferences in an开发者_JS百科droid 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?


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号