#[non_exhaustive]pub enum AppDir {
Data,
Cache,
PublicMedia,
}Expand description
The directory for the app.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Data
The directory for persistent-data files.
These files will be deleted when the app is uninstalled and may also be deleted at the user’s request.
Please note that, unlike PrivateDir::Data, it may be accessible by other apps or user.
e.g.
/storage/emulated/0/Android/data/{app-package-name}/files/storage/{sd-card-id}/Android/data/{app-package-name}/files
Cache
The directory for cache files.
These files will be deleted when the app is uninstalled and may also be deleted at the user’s request.
Please note that, unlike PrivateDir::Cache, it may be accessible by other apps or user.
e.g.
/storage/emulated/0/Android/data/{app-package-name}/cache/storage/{sd-card-id}/Android/data/{app-package-name}/cache
https://developer.android.com/reference/android/content/Context#getExternalCacheDirs()
PublicMedia
PublicDir of PublicStorage instead.The directory for shared media files to other apps or user.
These files will be deleted when the app is uninstalled and may also be deleted at the user’s request.
For Android 11 (API level 30) or higher,
this has been marked as deprecated.
It still works, but you should consider migrating to PublicDir of PublicStorage.
e.g.
/storage/emulated/0/Android/media/{app-package-name}/storage/{sd-card-id}/Android/media/{app-package-name}
https://developer.android.com/reference/android/content/Context#getExternalMediaDirs()