- What is the purpose of SharedPreferences in Android?
- Why it is used ?
- Where it want to be use?

- 445
- 3
- 14

- 278
- 4
- 15
-
1Have you goggled?? If yes then there is no need to ask this question. – InnocentKiller Feb 11 '14 at 06:39
-
try this link you will get all information regarding sharedpreferences. http://examples.javacodegeeks.com/android/core/content/android-sharedpreferences-example/ – skyshine Feb 11 '14 at 07:01
3 Answers
Shared preferences is used to save any primitive data: booleans, floats, ints, longs, and strings. This data will persist across user sessions (even if your application is killed). for more visit here
reference earlier answered
SharedPreferences is used to permanently store preferences in key:value pair
SharedPreferences is accessible by all the Activity(ies) of an app. Other app cannot directly access the content of shared_prefs
App stores its data/preferences in the SharedPreferences.
E.g. Say in a game u can store ur score, game level, user name, no of kill, etc in the preferences; so that it is accessible all throughout the game; yet by that particular game only.
Game "Gold Miner 2" does it. It is only one example.
Svox tts save ANDROID_ID in preferences file;
You need to keep in mind that if u delete the app, all SharedPreferences will be deleted (/data/data//shared_prefs);

- 181
- 12
You can read the developer android site about SharedPreference to save light data till your application exists into user's device. It will remain saved even after existing your application.
Storage in android with SharedPreference
Hope it will help you..!!!

- 3,052
- 4
- 26
- 58