Choose by task, not by settings label
| User task | Prefer investigating |
|---|---|
| Attach one photo | System photo picker |
| Import one PDF | Document picker through the Storage Access Framework |
| Browse a media library as a core feature | MediaStore with the required current access model |
| Store the app's own cache | App-specific storage |
| Manage many unrelated shared files | All-files eligibility only when genuinely justified |
The photo picker and storage overview offer narrower alternatives to blanket access.
Support limited access
On supported Android versions, users can grant selected media rather than the whole collection. Code should not interpret an incomplete query result as data loss or demand unrestricted access merely to continue.
Keep the UI aligned with the granted scope. Offer a way to select additional items when the feature needs them, and refresh access state when returning to the app.
Work with URIs safely
Use the returned URI and its granted access, not a guessed file path. Check MIME type and content where appropriate, bound memory usage and handle canceled selection. If the app needs long-lived access, follow the provider and API's documented persistable-grant behavior rather than assuming every URI lasts forever.
Keep permissions version-aware
Granular media permissions apply differently from legacy external-storage declarations. A copied manifest containing every old and new permission can over-request access without fixing the actual code path.
Document the supported API ranges and test each meaningful branch, including denial and revocation.
Review the release with APKLint
APKLint can help identify broad storage or media declarations in the merged manifest. It cannot tell whether a selected URI is still readable or whether the gallery UI handles partial access correctly. Those checks belong in the feature's runtime tests, including large files, remote providers and a user canceling the picker.
Sources and further reading
- Android Developers: Access media files from shared storage
- Android Developers: Photo picker
- Android Developers: Data and file storage overview
Reference review: 22 September 2026. Examples illustrate the workflow; check your installed versions, release artifact and account-specific Console requirements before applying them. This guide is not a claim that APKLint executed your project or verified your private account.



