OutsidePrivateDir

Type Alias OutsidePrivateDir 

Source
pub type OutsidePrivateDir = AppDir;
👎Deprecated: Use AppDir instead

Aliased Type§

pub enum OutsidePrivateDir {
    Data,
    Cache,
    PublicMedia,
}

Variants§

§

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

https://developer.android.com/reference/android/content/Context#getExternalFilesDirs(java.lang.String)

§

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

👎Deprecated: For Android 11 (API level 30) or higher, this is deprecated. Use 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()