Reputation: 1641
I'm creating a file world-readable using this instruction:
FileOutputStream fos = openFileOutput(filename.toString(), MODE_WORLD_READABLE);
file is created (i can see emulator's memory and file is there), but I can't find it on my device!! Where is it?
Upvotes: 0
Views: 65
Reputation: 76
The file is located in /data/data/com.yourpackagename/files/filename.txt which is hidden unless the device is rooted. You can access the file by copying it from the directory where it is created.
From the command line:
To copy a file
adb -d shell
run-as com.yourpackagename
cat /data/data/com.yourpackagename/files/filename.txt > /sdcard/filename.txt
Alternatively for a SQLite database
cat /data/data/com.yourpackagename/databases/dbname.db > /sdcard/dbname.sqlite
This solution will work without having to root the device.
Upvotes: 0
Reputation: 109237
In Application's Internal Storage.. by default /data/data/<package_name>/
Check this directory..
But if your device is non-rooted then you can not seen this file in DDMS -> FIle-Explorer.
For this you can try via commnad prompt using adb shell
If you want to just access files in your application then use,
getFilesDir()
Gets the absolute path to the filesystem directory where your internal files are saved.
Upvotes: 2