I created a demo for implementing the shared preferences and it worked for me. During the execution, i can see an xml file created unser the shared_prefs folder in the File Explorer. But why can’t i see that file created anywhere in my workspace? And again, when i re-run the application, then also the data is fetched from the xml file created under the shared_prefs folder. How is this file getting loaded automatically when i can’t see the file anywhere in the workspace? where is it stored actually?
Please help me in clearing the flow and concept about the shaed preferences.
Thanks,
Bunta
SharedPreferences aren’t part of project. That file is created by Android when you put some data inside them.
EDIT:
SharedPrefenreces are usually stored in device internal storage. When you run application for the first time and put some data in that them, SharedPreferences file is created inside /data/data//shared_prefs/.xml. Once created, sharedprefenreces can be deleted if you clear data (Settings->Application->Manage applications-> ->Clear data) or when you uninstall application.
I hope this helps.