Hello,
Welcome to our Microsoft Q&A platform!
Xamarin Forms won't allow access to the common external folders such as Documents/Pictures/etc... But when using the 'CrossFilePicker' addin it seems to allow access to files outside of the local App shell space.
It is not xamarin forms do not allow access to the common external folders, Platform do not allow access to the common external folders.
For example, starting in Android 11, apps that use the scoped storage model can access only their own app-specific cache files. apps cannot access the public file path.
How come these file pickers can access common file directory files outside the App space. but we cannot do the same through code ?
If you use Android 11, it cannot be achieved. If you use Android 10 or before, you can add android:requestLegacyExternalStorage
in the application
tag.
<manifest ... >
<!-- This attribute is "false" by default on apps targeting
Android 10 or higher. -->
<application android:requestLegacyExternalStorage="true" ... >
...
</application>
</manifest>
https://developer.android.com/about/versions/11/privacy/storage#manage-device-storage
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.