Describe SharedPreference storage option with example.
Answer Posted / 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 |
Post New Answer View All Answers
What information do you need before you begin coding an android app for a client?
Is it possible to use or add a fragment without using a user interface in Android?
What is the use of android manifest.xml?
What do you mean by adb?
What is the use of dagger?
How can I update my android device?
What is the dagger symbol used for?
What is the purpose of @override in android?
What is a job scheduling?
what is a toast notification in android?
What are the security measures that are taken to make android secure?
What are synthetic sensors?
What is the file features used in android?
Which of the best choice for simple animations for your website?
What is pojo class in android?