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 is data binding in android?
What language does Android support for application development?
Explain me the difference between oncreate() and onstart()?
Explain key components of android architecture?
What is an Implicit Intent in Android?
What is an application resource file?
what is the difference between dynamic receiver and static receiver?
Which of the used to detect when a user clicks or taps on a button?
Can you please explain the difference between data storage options which are available in android?
Why ios is faster than android?
Explain android application architecture?
What are the four asynctask methods that must be overridden?
How will apps change with android 2.2?
What is build.gradle?
How install android os from pc to mobile via usb?