Starting from Android 11, the MANAGE_EXTERNAL_STORAGE
permission is restricted due to the Scoped Storage feature that enhances app security and user privacy. To comply with these changes, it's recommended to follow the new storage access guidelines.
If your app needs to access files from external storage, consider the following alternatives:
MediaStore API: Use the MediaStore
API to access media files like images, audio, and videos. This provides secure access to media files without requesting special permissions.
Storage Access Framework (SAF): Implement SAF to allow users to select files using the system file picker. This enables your app to access files in a way that respects user privacy and permissions.
Internal Storage: Store app-specific files in the app's private storage directory, which doesn't require any special permissions. Use Context.getFilesDir()
or Context.getCacheDir()
.
Shared Storage: If you need to share files between your app and other apps, use the ACTION_OPEN_DOCUMENT
intent to allow users to select files.
Remember to update your app to follow the latest Android guidelines and ensure compliance with the changes introduced for storage access in Android 11 and later versions.