2

I forgot the name of a SharedPreferences file that I created a while back. My tablet is not rooted. Is there a way to view / list all SharedPreferences files ever created? If not, then it seems like I have a block of memory out there that I can never access again.

  1. I have tried the adb shell >> navigate to package >> ls approach. But I am not rooted so I receive the response: "opendir failed, Permission denied"

  2. I have looked around in my project directory as well as inside of eclipse, I cannot find any names of files that look like a sharedpreferences file.

  3. I have hooked up my tablet to my PC via usb and searched around the file explorer from within windows, Android > data > does not list my project.

What am I do to? How can I find out all of the names of past SharedPreferences files created?

Captainlonate
  • 4,878
  • 4
  • 25
  • 35

1 Answers1

2

Install the application on your Android emulator and use the DDMS File Explorer to find out :)

Ragunath Jawahar
  • 19,513
  • 22
  • 110
  • 155
  • Ok. Ragunath Jawahar's advice got me a little closer. I followed some other people's advice and tried to find: /data/data/YOUR_PACKAGE_NAME/shared_prefs/YOUR_PREFS_NAME.xml. The problem is inside of my package, there is only a /lib folder. Any more help? – Captainlonate Jul 07 '12 at 06:12
  • Your shared preference file has not been created yet. Try setting some properties or configurations from within your app and it will work. – Ragunath Jawahar Jul 07 '12 at 06:20
  • I also want to point out, that when trying this on the emulator, it is only going to recognize sharedpreference.xml files that were created at that time, or at some point when I ran this program on an emulator. I am actually trying to locate the .xml file on a tablet. When I try the DDMS approach on my tablet, I apparently cannot open the /data folder. In spite of my repeated attempts, the folder just won't expand. I assume it's a permissions thing. – Captainlonate Jul 07 '12 at 06:20
  • Ragunath, you were right about why the sharedPreferences folder didn't show up. I was able to get that to show up. But only on the emulator, and only because I actually created a new sharedPreferences file just now. This lead me to understand that since I had never previously ran the program on the emulator (back when i initially created the .xml file whose name i have forgotten), it won't show up. But I am certain that it is located on my tablet... If I could just navigate to it... – Captainlonate Jul 07 '12 at 06:23
  • On this site: http://stackoverflow.com/questions/4935388/ddms-file-explorer-cant-access-data-data-htc-desire-hd Someone said that you cannot access /data without being rooted. Thanks to you I am sure that the .xml file I am searching for it located in a subdirectory of /data, I am now positive that my new goal is to gain access to /data ( without rooting of course ). Can you help with this? – Captainlonate Jul 07 '12 at 06:27
  • Yes that's correct, you cannot access the /data if your device is not rooted. – Ragunath Jawahar Jul 07 '12 at 06:28
  • Ok. I am going to bring this thread to an end. Ragunath, my initial question was where the list of SharedPreferences .xml files were located, and thanks to you and others on stackoverflow.com, I now know where. I cannot access them, but that's a separate issue I'll have to address later. Thank you Ragunath. I have accepted your answer as correct (with the checkmark thing). :) – Captainlonate Jul 07 '12 at 06:31