views:

44

answers:

1

I can access the preferences and add and change them. How can I view the entire file that stores the keys and values for sharedpreferences in my app. I have changed, added and removed some keys from my code and would like to see the effect on the preference file.

+1  A: 

Eclipse, menu/Window/Show View/File Explorer. If "File Explorer" is not in the menu, then click "Other..." and find it under the Android category.

In the file tree, find your app's data folder under /data/data/com.your-package/shared_prefs. The preference file will be there, as an XML. Copy it from the device and enjoy.

Alternatively, you can open a command line to the device/AVD using the ADB tool, and use the UNIX standard "cat" command.

Seva Alekseyev
OK during emulation it loads up the data/data and I can find the file in File Manager. However, I have not figured out how to view this file or copy it. I cant drag or right click or double click the file. How can I view the contents of that xml file?
Tim Wayne
In the upper right corner of the file explorer are two icons one with a disk and one with a mobile phone. This icons will allow you to copy files from and to the phone.
Janusz
Money. Thanks people.
Tim Wayne