Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Android, where are files saved by default?

Tags:

android

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?

like image 261
ycomp Avatar asked Feb 21 '23 14:02

ycomp


2 Answers

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

like image 67
ᅙᄉᅙ Avatar answered Mar 11 '23 19:03

ᅙᄉᅙ


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().

like image 36
CommonsWare Avatar answered Mar 11 '23 19:03

CommonsWare