Пути и папки в Android
1) Системные папки
⚠️ Писать сюда никак нельзя
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
2) Внешнее хранилище
⚠️ Нужны права WRITE_EXTERNAL_STORAGE
Method | Result |
---|---|
Environment.getExternalStorageDirectory() | /storage/sdcard0 |
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_ALARMS) | /storage/sdcard0/Alarms |
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM) | /storage/sdcard0/DCIM |
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) | /storage/sdcard0/Download |
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES) | /storage/sdcard0/Movies |
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC) | /storage/sdcard0/Music |
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_NOTIFICATIONS) | /storage/sdcard0/Notifications |
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) | /storage/sdcard0/Pictures |
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PODCASTS) | /storage/sdcard0/Podcasts |
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RINGTONES) | /storage/sdcard0/Ringtones |
3) Папки приложения
Method | Result |
---|---|
getCacheDir() | /data/data/package/cache |
getFilesDir() | /data/data/package/files |
getFilesDir().getParent() | /data/data/package |
4) Папки приложения на внешнем носителе
Method | Result |
---|---|
getExternalCacheDir() | /storage/sdcard0/Android/data/package/cache |
getExternalFilesDir(null) | /storage/sdcard0/Android/data/package/files |
getExternalFilesDir(Environment.DIRECTORY_ALARMS) | /storage/sdcard0/Android/data/package/files/Alarms |
getExternalFilesDir(Environment.DIRECTORY_DCIM) | /storage/sdcard0/Android/data/package/files/DCIM |
getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS) | /storage/sdcard0/Android/data/package/files/Download |
getExternalFilesDir(Environment.DIRECTORY_MOVIES) | /storage/sdcard0/Android/data/package/files/Movies |
getExternalFilesDir(Environment.DIRECTORY_MUSIC) | /storage/sdcard0/Android/data/package/files/Music |
getExternalFilesDir(Environment.DIRECTORY_NOTIFICATIONS) | /storage/sdcard0/Android/data/package/files/Notifications |
getExternalFilesDir(Environment.DIRECTORY_PICTURES) | /storage/sdcard0/Android/data/package/files/Pictures |
getExternalFilesDir(Environment.DIRECTORY_PODCASTS) | /storage/sdcard0/Android/data/package/files/Podcasts |
getExternalFilesDir(Environment.DIRECTORY_RINGTONES) | /storage/sdcard0/Android/data/package/files/Ringtones |