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 activity class do you need to inherit to show google map?
What are broadcast receivers?
Is android lollipop still supported?
What is the android:versioncode attribute in the androidmanifest.xml file?
What is api level, codename of android 5.0 – 5.1?
How do I turn on auto sync on android?
which language is supported by android for application development?
Does selenium support google android operating system?
What is android ndk?
What is the API profile exposed by Mono for Android?
What is android:oneshot?
Why bytecode cannot be run in android?