-2

I am using a PreferenceActivity to save some user preferences.
I want to access the default Preference file from outside the app for debugging purposes.

How can I change the defaultSharedPreferences file from private to public mode?
And also what is the default name of that defaultSharedPreference file?

[EDIT]

One negative vote that means something is wrong with the question.
At least, do let me know whats wrong!
That would be less cruel and not discouraging for a newbie like me :)

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Srujan Barai
  • 2,295
  • 4
  • 29
  • 52

1 Answers1

1

In the DDMS (or its equivalent, in Android Studio), the path to your preference file is /data/data/your.app.name/shared_prefs/your.app.name_preferences.xml.
You can export it, modify it, and even reimport it (at your own risk!).


EDIT

The path is correct, the file name might vary.

enter image description here

Sorry, I wasn't pointing the xml file, while taking the screen shot.
But it's there.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
  • No such path exist. Infact there is no such file or folder that has the name of my app. Well the app is working perfectly. – Srujan Barai Aug 28 '15 at 13:09
  • 1
    The **path** is correct. The **file name** might vary. – Phantômaxx Aug 28 '15 at 13:18
  • This is so simple, yet im stuck. I fear im doing something terribly wrong – Srujan Barai Aug 28 '15 at 13:25
  • 1
    I added a picture to my answer. Maybe it's worth 1000 words. Sorry I wasn't pointing the xml file, but it's there. – Phantômaxx Aug 28 '15 at 13:26
  • Nothing would have help me more then the pic, but I am facing a weird problem. I am not able to explore folders in android studio Android Device Monitor. What could be the possible reason? This was a totally different problem so I elaborated it here with the pic: http://stackoverflow.com/questions/32275988/android-studio-android-device-monitors-file-explorer-not-working/32276097#32276097 – Srujan Barai Aug 28 '15 at 17:06
  • 1
    All done. I started using [root] adbd Insecure and now everything is working. THanks – Srujan Barai Aug 28 '15 at 17:58