Understanding the internal structure of the Android file system is necessary not only for developers, but also for advanced users who want to optimize the performance of their device. When you install application from Google Play or a third-party source, the operating system allocates a strictly defined space for it, isolated from other processes. This isolation is fundamental to the security of the platform, preventing unauthorized access to sensitive information.

In most cases, the standard user sees only the tip of the iceberg through file managers that display only public sections. However, the real picture is much more complex and depends on the version of the operating system, access rights and the type of stored data. Android uses a complex hierarchy of directories, where each level has its own restrictions and purpose.

In this article we will look in detail at where exactly files are written, how system directories differ from user directories, and how modern versions of Android restrict access to these areas. You'll learn about sandbox mechanismsthe role of the cache and ways to manage data without gaining full superuser rights. This knowledge will help you effectively manage the device's memory.

File system architecture and sandbox principle

The fundamental basis of data storage in Android is the concept sandbox (sandbox). Each installed application runs under a unique Linux user ID (UID), which automatically isolates its files from other apps. This means that, by default, no application has the right to read or write data to another application's folder without explicit permission from the system or user.

Physically, all data is located on the internal drive, which is mounted as a partition /data. It is here, deep in the system directories, that the main information lies: databases, settings, logs and game saves. Access to this section without rights root (superuser) for a regular file manager is closed, which protects the system from accidental or malicious damage to critical files.

โš ๏ธ Attempts to gain root access to view system folders may lead to disruption of applications that use system integrity checks (SafetyNet, Play Integrity), including banking apps.

There is also a division into the internal memory of the device and external storage devices (SD cards). Although this often looks like a single space to the user, from the operating system's point of view they are different mount points with different access levels. Internal memory (/data) is encrypted and secure, while external cards often use the FAT32 or exFAT file system, which does not support Linux permissions, making the data on them more vulnerable.

๐Ÿ“Š Where do you prefer to store application files?
Internal memory only
On an SD card (if possible)
In cloud services
Didn't think about it

System directory /data/app and user data

The heart of application storage is the directory /data/app. This is where APK files of apps are installed after downloading from the store. However, the installation file itself is just executable code. All dynamic data created during use is stored in a contiguous but separate directory structure, access to which is strictly regulated.

For each application, a personal folder is created along the path /data/data/ (or /data/user/0/ on devices that support multiple users). Inside this directory there are subfolders files, databases, shared_prefs and code_cache. Authorization tokens, interface settings and other critical information are stored here. SQLite databases, authorization tokens, interface settings and other critical information.

It is important to note that clearing application data through Android settings actually executes a command to delete the contents of this particular directory. This returns the app to the "first run" state. If you try to manually delete files from here without root, the system will throw an access error, which is normal behavior of security mechanisms.

๐Ÿ’ก

Use ADB (Android Debug Bridge) from your computer to safely browse the folder structure without having to root the device itself.

Developers often use these hidden directories to store cached images or temporary files to avoid clutter space visible to the user. However, incorrect operation of the application can lead to the growth of these folders to gigantic sizes, which requires intervention through the memory management menu or specialized utilities.

Public storage: role of the /storage/emulated/0 directory

Unlike the protected system zone, there is an area designed for exchanging files between applications and accessible to the user. In modern versions of Android, this path looks like /storage/emulated/0, which in file managers is often displayed simply as "Internal memory". This is where the folders Download, DCIM, Music and other standard directories are located.

Applications to which you have given permission to access files create their own folders here with names corresponding to their packages or developer names. For example, instant messengers save received media files in Android/media or in the root directory so that the user can easily find and share them. This space is not as highly encrypted as /dataand is readable and writable by most apps.

With the release of Android 11 and the introduction of Scoped Storage, the rules of the game have changed. Applications are now prohibited from freely scanning all internal memory. They can only work with their own folders in Android/data and Android/obb, as well as with media files of a certain type. This significantly improved data privacybut complicated the work of file managers.

Why is the Android/data folder sometimes empty?

On Android 11+, access to this folder is limited. Standard file managers may not see its contents. Access requires special permissions or use of system explorer through hidden menus.

Users should regularly check the contents of public folders for โ€œdigital junk.โ€ Many applications create logs or temporary copies of files here that are never deleted automatically. This data is safe for the system, but can free up gigabytes of free space.

Differences between cache, data and OBB files

When analyzing the occupied space on a smartphone, the user often comes across three concepts: application size, data size and cache size. Understanding the difference between them is critical for proper optimization. Cache are temporary files that speed up the app (thumbnails, intermediate downloads), which can be deleted without loss of functionality.

Application Data is your personal information: correspondence, progress in games, downloaded maps for offline navigation, account settings. Removing this partition is equivalent to reinstalling the application from scratch. OBB files (Opaque Binary Blob) are usually used by heavy games to store graphics and resources, and they are located separately in the folder /Android/obb.

The table below compares the characteristics of different types of data storage:

Data type Location Impact of deletion Access without Root
APK (Application) /data/app The app will stop starting No (only via ADB/Root)
Data /data/data Reset settings and loss of progress No
Cache /data/cache Safe, the application will create again No (only through settings)
Media/Files /storage/emulated/0 Loss of photos, documents, downloads Yes (full access)

Particular attention should be paid OBB files. If you delete the game but leave the OBB file in the /Android/obbfolder, it will simply take up space, since without the main APK file it is useless. Conversely, when installing heavy games through installer files (XAPK), the absence of an OBB file in the correct place will cause the game to crash on startup.

๐Ÿ’ก

Clearing the cache is safe and often solves problems with application freezing, while clearing data resets the app to its original state.

Access restrictions in Android 11, 12, 13 and newer

Starting with the eleventh version, Google radically revised its file system access policy by introducing Scoped Storage. Now applications cannot simply request permission to read all internal memory. If previously it was enough to give access to the โ€œStorageโ€, now access is limited to specific file types (photos, video, audio) or the applicationโ€™s own directories.

This change also affected the folder Android/data. Previously, file managers could freely show its contents, allowing you to clear the Telegram or WhatsApp cache manually. Now, when you try to go there, the standard explorer may show an empty folder or ask for a special permission, which is given only after going to the system menu.

โš ๏ธ Attention: Shell interfaces (MIUI, OneUI, ColorOS) may implement access to system folders differently. If one file manager does not see the folder, try using the standard "Files" from Google or third-party solutions that support SAF (Storage Access Framework).

For developers, this means the need to use API Storage Access Framework to work with user files. For ordinary users, this increases security, since a malicious application, even if it has gained rights, will not be able to stealthily steal all your documents or photo albums by scanning the entire drive.

However, there are workarounds. Using the MTP protocol to connect to a PC, using ADB commands or special system plugins allows you to access hidden areas Android/data even on new versions of the OS. This is necessary, for example, for manual backup of settings for instant messengers that do not have their own cloud synchronization.

Memory management and cleaning of unused data

Effective management of disk space requires regular monitoring of what exactly applications are taking up. Android's built-in tools provide basic statistics, but in-depth analysis often requires more advanced tools. It is recommended to periodically check the "Memory" section in the system settings, sorting applications by the size of the data they occupy.

Many users make the mistake of deleting an application, but forgetting about the residual files in public folders. After uninstalling the app, you should manually check the root of the internal memory and the folder Download for the presence of directories with the name of the removed application. This is especially true for heavy graphic editors or navigators.

โ˜‘๏ธ Checklist for clearing memory

Completed: 0 / 5

Using cloud services to store rarely used files (photo archives, documents) can significantly relieve the internal memory of the device. Modern smartphones often do not have a slot for a memory card, so internal storage is the only and critical resource that needs to be protected.

It is also worth paying attention to the "Clear all data" function in the settings of a specific application. It is useful when the app does not work correctly, is buggy, or takes up an abnormally large amount of space due to a bloated cache. This action will return the application to factory settings, eliminating software errors associated with damage to local configuration files.

Is it possible to transfer application data to an SD card?

On modern versions of Android (starting from 7.0 and higher), the standard ability to transfer applications to an SD card has been practically eliminated by manufacturers and Google due to low speed and reliability flash memory cards. Some shells allow you to transfer only part of the data (media files), but the main executable files and databases remain in the internal memory.

Where are Wi-Fi passwords and accounts stored?

Wi-Fi passwords saved in the system are in an encrypted file wpa_supplicant.conf inside the system section /data/misc/wifi. It can only be accessed with root access. Passwords for Google accounts and applications are stored in a secure key store (Keystore) and are not available for direct reading even with superuser rights in clear text.

What to do if the data folder has swollen to enormous sizes?

If the system partition /data full, the phone may stop loading or work extremely slowly. First of all, you need to remove large applications and their cache. If this does not help, you may need to perform a factory reset (Wipe Data/Factory Reset), which will completely clear the user data partition. Is it safe to use cleaners for the Android folder? Most third-party cleaners have limited access due to Scoped Storage and often just show ads. Built-in Android cleaning tools (in the Settings -> Storage section) work safer and more efficiently, as they have system rights to delete the cache. Using aggressive third-party utilities can lead to the deletion of necessary files or disruption of applications.

Is it safe to use cleaners for the Android folder?

Most third party "scrapers" have limited access due to Scoped Storage and often just show ads. Built-in Android cleaning tools (in the Settings -> Storage section) work safer and more efficiently, as they have system rights to delete the cache. Using aggressive third-party utilities can lead to the deletion of necessary files or disruption of applications.