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 |
What are the life cycle methods of android activity?
Can you deploy executable jars on android?
What is the difference between thread and a service in Android?
0 Answers SkillGun Technologies,
In android, which is two location providers that you can use to obtain your position data?
Please explain what are intent filters?
How does Android system track the applications?
How to create alerts in android?
Activity results handled by the onactivityresult() method are differentiated from one another using which code?
What are the tools are placed in an android sdk?
Is android 4.0 still supported?
What is use of rxjava in android?
What are the advantages of android operating system?