Describe SharedPreference storage option with example.
Answer / shubhraneel
If we talk about Android, then there are many ways in which it stores data of application. One way is by Shared Preferences. Shared Preferences allow you to save and retrieve data in the form of key,value pair.
In order to use shared preferences , you have to call a method getSharedPreferences() that returns a SharedPreference instance pointing to the file that contains the values of preferences.
example: SharedPreferences sharedpreferences = getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);
In the above example The first parameter is the key and the second parameter is the MODE
| Is This Answer Correct ? | 1 Yes | 0 No |
How to disable landscape mode in android?
Who inventors of android ?
 How is Mono for Android licensed?
Explain the services component of android?
 Why would I (potentially) choose an Android phone over an iPhone?
What are the key components of Android Architecture?
State few disadvantages of android in the mobile market.
Can the user set a priority?
In android, the process technical to convert an address into its latitude and longitude is called?
What's the difference between android oreo and android pie?
When will it be available in a ROM?
Explain the Architecture of Android ?