Skip to content

Instantly share code, notes, and snippets.

@AndrewEQ
Last active February 1, 2019 07:40
Show Gist options
  • Save AndrewEQ/431c7a11dad1e13d93e27e2e238dc1f8 to your computer and use it in GitHub Desktop.
Save AndrewEQ/431c7a11dad1e13d93e27e2e238dc1f8 to your computer and use it in GitHub Desktop.
List of XML tags for FileProvider paths
XML tag Corresponding storage call When to use
<files-path> Context.getFilesDir() Data can only be viewed by app. Deleted when uninstalled (/data/data/[packagename]/files).
<external-files-dir> Context.getExternalFilesDir() Data can be read/write by the app. Any apps granted with READ_STORAGE permission can read too. Deleted when uninstalled (/Android/data/[packagename]/files).
<cache-path> Context.getCacheDir() Temporary file storage.
<external-path> Environment.getExternalStoragePublicDirectory() Data can be read/write by the app. Any apps can view. Files not deleted when uninstalled.
<external-cache-path> Context.getExternalCacheDir() Temporary file storage with usually larger space.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment