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
Does android support the bluetooth serial port profile? Yes. 78. Can an application be started on powerup?
What is gradle/ directory?
What method does android follow to track applications?
Describe the android application architecture.
Which is better colour os or miui?
Is android free for manufacturers?
How to start another activity?
Tell us is it possible to started an application on powerup?
How long does compatibility take?
Explain key components of android architecture?
What item are important in every android project ?
What is nest?
What is sleep mode in android?
What are different data storage options are available in android?
Why did we open the android source code? What is the guardian app for android?