Yoodley is reader-supported. When you buy through links on our site, we may earn an affiliate commission.
If you’re an Android user, this is a question that must have come across your mind at least once. Any app that you download from Google Playstore, or any app that you download via APKs, all require to both store and retrieve data in order to actually function. So, where do these apps store their data, and moreover? If they store it in the device, is it saved in the internal storage or the external storage?
This is what we’ll discuss in this post and much more.
Where do Android Apps store data in the Internal Storage?
Android Apps store data in the Internal Storage in /data/data/<package_name>. This pathway, also known as Shared Storage, is where all apps (either from Play Store or downloaded from APK files) store their data. Package names are assigned by app developers, so if you are looking for files of a package that’s named ‘magicstar’, you’ll find it under /data/data/<magicstar>
Here are the different sub-folders in the /data/data/<package_name> folder that specifically store different models of data of apps:
- databases/: stores the app’s databases
- shared_prefs/: preferences and settings
- files/: other related files
- cache/: stores cache; files from this folder are what are indirectly cleared from under ‘Applications’ from ‘Settings’ when you clear cache.
- lib/: stores libraries and helpers for the app
The directory can be found in a file folder or another folder such as /Android/ Data/ App/ or /System/ Data/ App/
You can also find stored Android App data that comes from a different source in the following directories:
- /system/app/:Contains pre-installed system apps
- /data/asec/: Stores secure apps generated from external memory storage
- /data/app-private: Contains third party protected apps
Where are the files located after .apk installation on Android devices?
An app installed through APK will store the files in the same pathways as other apps (that are similar to it in nature).
For example, if you install an app from pre-downloaded APKs on your android device, it will store its data in /system/app. The privileged apps will be storing their data in the following location, which is mounted as read-only to prevent any alteration by other apps, or the user: /system/priv-app.
Any other general app data will be stored where all other generic apps store their data, i.e., /data/app.
If you’ve downloaded an APK on the external storage of your device, the files and the data of the .apk installation will be located in /mnt/sdcard/Android/data.
Where will files of games downloaded from play store be stored?
On any Android device, you must have found an ‘obb’ folder, and wondered what it is. Well, this is where your game files are stored on an android device in general. The pathway is as follows: Internal Storage > Android > Obb folder.
If you have external storage on your device, and you could not seem to find the ‘obb’ folder in the internal storage, look for it in the external storage, under the following pathway: SD Card > Android > Obb
Where do Android Apps store data in the External Storage?
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.
As in the external storage, the android apps store their data in external storage in different directories based on the nature of data to be stored and the application. On a general note, android apps store their data in external storage in Android/data/<package_name> or sdcard/data/<package_name>
Q. Where to store app data when making applications?
A. When it comes to storing your app data on a device, on a broad note, you can do it on:
- Internal Storage
You can choose from the following two methods to save your application files in the Internal Storage: getFilesDir() and getCacheDir(). The ruling difference between both of these methods is that the former returns the absolute path to the directory where the files originated in the file system. The latter returns the absolute path to the directory specific to the application used for storing cache in the file system.
Tip: It’s a known fact that when a user installs an application on their device, the android system provides the application with an allocation in the file storage, where the application can store its data, which can not be read or overwritten (unless on a rooted device) by another application. When the application is deleted, so is all the data associated with it.
This is why we recommend you use Internal Storage only when you need to store private data for the application on the android device. When you’re creating an application that stores data that can be used by other applications, using internal storage can be risky. Once the app is uninstalled or deleted, so will be the data.
- External Storage
To store android app data on the external device on an android device, you’ll need the following permission from the user: READ_EXTERNAL_STORAGE.
This storage is viable for storing your app data if it is shared by other applications, unlike internal storage. However, if your app uses private data, avoid using external storage for the same.