-->
G33K-TRICKS

Tuesday, January 26, 2021

Android App directory and desciption


Details of mostly used Android Apps Directories and their description Have you ever wonder why there are so many directories in your Android Phone and what purpose they do serve. Lets take a quick dive into what are those different Android Application Directories in your mobile phone. Below table can give you quick overview of it.
Android App Directory


We have 'apps' directory which is self explainatory. The data for the application that are pre-installed or the ones that you would install would sit in this folders. 

APPLICATIONS:
/data/app/* - This is for the users application Installation space 
/data/app/*/base.apk - Space for Android default or preinstalled system apps
/data/app/*/lib//*.so - Space for Shared Libraries(so = shared object similar to dll)
/data/app/*/oat//base.[art|odex|vdex] - Space of compiled executable code that we installed
/data/dalvik-cache//*.[art|dex|oat|vdex] - Space of compiled executable code only for preinstalled apps
/data/misc/profiles/cur///primary.prof - Androd RunTime Profile (refer: https://source.android.com/devices/bootloader/boot-image-profiles)
/data/misc/profiles/ref//primary.prof - Androd RunTime Profile (refer: https://source.android.com/devices/bootloader/boot-image-profiles


Next is user directory under Internal Storage

Internal Storage:
/data/user[_de]/<user_id>/<pkg> - To fetch data from this path use getDataDir()
/data/user[_de]/<user_id>/<pkg>/files - To fetch data from this path use getFilesDir()
/data/user[_de]/<user_id>/<pkg>/[code_]cache - To fetch data from this path use getCacheDir() or getCodeCacheDir()
/data/user[_de]/<user_id>/<pkg>/databases - To fetch data from this path use getDatabasePath()
/data/user[_de]/<user_id>/<pkg>/no_backup - To fetch data from this path use getNoBackupFilesDir()
/data/user[_de]/<user_id>/<pkg>/shared_prefs - To fetch data from this path use getSharedPreferences()

Next is external storage and directories present in external path like SDCard

External Storage:

/storage/emulated/obb/<pkg>/*.obb - Shared by multi-users, exposed in following view)

/storage/emulated/<user_id>/Android/obb/<pkg>/*.<pkg>.obb - To fetch data from this path use getObbDirs()

/storage/emulated/<user_id>/Android/media/<pkg> - To fetch data from this path use getExternalMediaDirs()

/storage/emulated/<user_id>/Android/data/<pkg>/ - To fetch data from this path use getExternalMediaDirs()

/storage/emulated/<user_id>/Android/data/<pkg>/files To fetch data from this path use getExternalFilesDirs()

/storage/emulated/<user_id>/Android/data/<pkg>/[code_]cache - To fetch data from this path use getExternalCacheDirs()



 TLDR, here it is in Tabular format for quick reference.

Android Apps directory and Description