ycomp
ycomp

Reputation: 8563

In Android, where are files saved by default?

If I save a file without any path name .. e.g. "abc.txt" ... where would it be saved on the device ?

where should I look in emulator file system if to try to find a file I saved?

Upvotes: 7

Views: 11950

Answers (2)

P Varga
P Varga

Reputation: 20219

/data/data/your.app.package.name/files, but note this can be device dependent so you should follow CommonsGuy's advice!

Upvotes: 8

CommonsWare
CommonsWare

Reputation: 1006554

If I save a file without any path name .. e.g. "abc.txt" ... where would it be saved on the device ?

Don't do that.

Use getFilesDir() to get at the root of your application-local file area on internal storage. Or, use openFileOutput(), which gives you an OutputStream to a file in the directory identified by getFilesDir().

Upvotes: 5

Related Questions