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 |
Which is the best android version?
what is a fragment? How it differs from activity?
Explain localization?
Creating an android application using the eclipse plugin?
What are the different states wherein a process is based?
How to set position of a sencha touch component?
What is intent in Android?
What is frame animation?
Differentiate between linearlayout, relativelayout, absolutelayout.
Why is android called oreo?
what does android run on ?
Does Android support push email or is it pull?