Android Folder Description

Reference: http://blog.csdn.net/buptlzx/article/details/8773447

 

First, the internal storage path is /data/data/youPackageName/. The paths explained below are based on the internal storage path of your own application. All files saved in internal storage are deleted when the user uninstalls the app.

 
1. files
1. Context.getFilesDir(), this method returns the File object of /data/data/youPackageName/files.
2. Context.openFileInput() and Context.openFileOutput() can only read and write files under files, and return FileInputStream and FileOutputStream objects. www.2cto.com
3. Context.fileList(), returns all file names under files, and returns a String[] object.
4. Context.deleteFile(String), delete the file with the specified name under files.
 
2. cache
1. Context.getCacheDir(), this method returns the File object of /data/data/youPackageName/cache.
 
3. custom dir
getDir(String name, int mode), returns the folder File object with the specified name under /data/data/youPackageName/, if the folder does not exist, it will create a new folder with the specified name.
 
 

Standard notation for some paths

 Environment.getDataDirectory() = /data
 Environment.getDownloadCacheDirectory() = /cache
 Environment.getExternalStorageDirectory() = /mnt/sdcard
 Environment.getRootDirectory() = /system
 context.getCacheDir() = /data/data/com.mt.mtpp/cache
 context.getExternalCacheDir() = /mnt/sdcard/Android/data/com.mt.mtpp/cache
 context.getFilesDir() = /data/data/com.mt.mtpp/files

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326280794&siteId=291194637