When I created a preferences xml file (by right-clicking the project name, selecting | New | Other | Android XML File, and then selecting "Preference" from the "Resource Type" spinner in the "New Android XML File" dialog), it saved it in res/xml rather than res/layout. Is this as it should be?
By Default the SharedPreference file is store in to the respective Project directory with that preference name and with xml formate.
If you want to see that file or view the data of that file in Eclipse then do as below:
goto FileExplorer in DDMS of Eclipse then
data/data/YOUR_APPLICATIO_PACKAGE/shared_prefs/abc.xml
Here, abc.xml is your preference file that you have created during the application execution. Now copy that file to the PC and you can view the data and its value that you have saved to the shared_prefs.
Enjoy. :)
Yes, the preference xml file should be in the res/xml
directory.
The res/layout
directory, as the name suggests, is only for layout xml files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With