92

Could you list all possible directories where Android apps may store data, providing description what kind of data are stored in each directory?

87

All apps (root or not) have a default data directory, which is /data/data/<package_name>. By default, the apps databases, settings, and all other data go here. If an app expects huge amounts of data to be stored, or for other reasons wants to "be nice to internal storage", there's a corresponding directory on the SDCard (Android/data/<package_name>).

Apart from that, all apps can store data anywhere on the SDCard, as there are no restrictions -- and many apps do so. They can use directory names freely (and they again do), which is what often makes it hard to decide what all that "junk" on the card is intended for, and what of it can be deleted.

Though, as Tom pointed out, root-apps could store their data almost everywhere on your device, they usually follow the same rules as other apps.

You can find a general explanation of the Android directory hierarchy in my answer here. For your specific question I might add some more details on the /data/data/<package_name> (and corresponding SD-part):

  • databases/: here go the app's databases
  • lib/: libraries and helpers for the app
  • files/: other related files
  • shared_prefs/: preferences and settings
  • cache/: well, caches

There might be several more directories in this place, or fewer -- it all depends on the app. In its own "home directory" (and that's what it basically is, spoken Linux-wise) they can place files where they want. Usually, these files and directories are only accessible by the app itself (and root, of course) -- other than those stored on the SDCard, which are accessible by all apps.

  • 1
    Is /data/data/<name>/files/ where files created as described in developer.android.com/guide/topics/data/… would go? I.e. those opened with FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);? – Nobody Feb 4 '18 at 17:27
  • An just in general, this is already a nice answer, but what about adding references to developer.android.com/guide/topics/data/… about which directory correlates to which abstract/path-agnostic description there? – Nobody Feb 4 '18 at 17:29
  • @Nobody 2) because that page is heavily developer oriented, while this site is end-user oriented? Same for 1) I'm no developer, and that asks for development details. Sorry. – Izzy Feb 5 '18 at 9:43
  • Sorry, to me that user/developer distiction is a bit fuzzy, just asked in case you knew it off the top of your head. Thanks anyway. – Nobody Feb 5 '18 at 15:45
  • 1
    I do not have an SD card, and in my Android 6 and Android 7, Whatsapp stored lots of data in /storage/emulated/0/WhatsApp/ (subdirs .Shared, .trash, Backups, Databases, Media), including all media. I do not know if this is in addition to \data\data..., I cannot access this directory now. Maybe this changed among versions. – sancho.s Jul 4 '18 at 11:22
8

The answer to your question you are asking is too big. I can, however, give you a basic answer which covers the basics.

There are two kinds of apps:
Root and non-root.

Root apps can basically store/modify files wherever they want.

Non-root apps can only store/modify files here: /sdcard/ and every folder what comes after.
Mostly, the installed apps store themselves at /sdcard/Android/data or /sdcard/Android/obb.
Some apps store their save games/configuration data files on /sdcard/APPNAME/, or just on the /sdcard/

To be able to use root apps, you'll need to have rooted your Android device and have given permission from one of the superuser apps.

protected by Community Jun 26 '18 at 20:48

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.