For debugging purposes I need to access the shared preferences file of my application. As far as I know I should find this file in /data/… but I can’t access the /data folder through to missing permissions. Is this normal? Any way to still access the file? (except maybe raeding it from inside the application?) The phone is not rooted and I also don’t want to root it.
Thanks for any hint!
For debugging purposes I need to access the shared preferences file of my application.
Share
I have ran into this issue in the past (not having root permission on the file system but needing access to the applications data folder). If you don’t have a rooted device or a developer device such as the ADP1 then you can try running your application on the emulator and then accessing the files from the “File Explorer” in eclipse or DDMS.
EDIT #1:
Try using the getAll function of sharedPreferences and saving that to a file, I will see if I can throw together a sample.
EDIT #2:
Example Code, created from random samples around the net, probably not the best way to do it, but I tested it and it does work. It writes a file to the root of your sdcard. Make sure you have
set in your manifest
Sources One Two Three