Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

[Explained] Android App directories and methods to access these directories

Android App directories and methods to be used to access these app directories 


Have you ever wonder why there are so many directories in your Android Phone and what purpose they do serve. As, Android, basically uses Linux as a base platform, it's likely to have Linux like file system structure. Let's take a quick dive into what are those different Android Application Directories in your Android mobile phone and then I've also mentioned the methods that can be used in your android application to access the data from these directories.





We have 'apps' directory which is self explanatory. 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]// - To fetch data from this path use getDataDir()
/data/user[_de]///files - To fetch data from this path use getFilesDir()
/data/user[_de]///[code_]cache - To fetch data from this path use getCacheDir() or getCodeCacheDir()
/data/user[_de]///databases - To fetch data from this path use getDatabasePath()
/data/user[_de]///no_backup - To fetch data from this path use getNoBackupFilesDir()
/data/user[_de]///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//*.obb - Shared by multi-users, exposed in following view)

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

/storage/emulated//Android/media/To fetch data from this path use getExternalMediaDirs()

/storage/emulated//Android/data// - To fetch data from this path use getExternalMediaDirs()

/storage/emulated//Android/data//files To fetch data from this path use getExternalFilesDirs()

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



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



This post first appeared on G33K-TRICKS - Your Source To Tips And Tricks, please read the originial post: here

Share the post

[Explained] Android App directories and methods to access these directories

×

Subscribe to G33k-tricks - Your Source To Tips And Tricks

Get updates delivered right to your inbox!

Thank you for your subscription

×