What do you know about the history of file storage in Android?
sobes.tech AI
Answer from AI
The history of file storage in Android has gone through several key stages, reflecting the desire to improve security, privacy, and ease of data management.
Initially, in early versions of Android, access to the file system was relatively open. Applications could read and write files almost anywhere on external storage (SD card), using access rights WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE. This created issues with data organization, conflicts between applications, and security, as one application could access another's data.
The situation began to change with the introduction of the sandbox concept for each application. Each app was given a dedicated private space for storing its data (Context.getFilesDir(), Context.getCacheDir()), which other applications could not access directly.
With Android 4.4 (KitKat), the Storage Access Framework (SAF) was introduced – an API for managing access to documents and other files through a special system UI. This allowed users to select files and directories, granting the app temporary access to their contents without the need to provide broad READ_EXTERNAL_STORAGE rights.
Significant changes occurred with Android 6.0 (Marshmallow) with the introduction of Runtime Permissions. Permissions to read and write external storage were requested from the user at runtime, increasing transparency and control over data access.
Android 10 (Q) introduced Scoped Storage. This was the most substantial change in many years. Instead of broad access to all external storage, apps by default are granted access only to:
- Their own private directories (
getExternalFilesDir()). - Shared media collections (photos, videos, audio) via the MediaStore API.
- Other files selected by the user through SAF.
Broad access to external storage for certain file types (e.g., document files) became possible only through SAF. For apps that needed access to all files (e.g., file managers), a new permission MANAGE_EXTERNAL_STORAGE was introduced, which requires special consideration and is not granted to most apps.
Some important points:
- Internal storage has always been private to each app.
- External storage has evolved from open access to strictly controlled and isolated storage for each app.
- MediaStore is the preferred way to work with media files in shared collections.
- SAF provides a safe and convenient way for users to grant apps access to files outside their private space.
The evolution of the storage system reflects Google's efforts to enhance user data security and simplify file management for developers.