Reading/Writing files from the Documents folder on Android

Phunction 301 Reputation points
2022-06-06T02:36:30+00:00

Hi, I am trying to allow my app to read and write files to the public Documents folder. This works fine in the app if I create a file there I can read it.

However the issue is, I need my app to be able to read files there that are copied over from a PC. Users need to be able to copy files back and forth to their PC through File Explorer, but anything copied to the Documents folder on Android are not visible to the app. How can I allow this? Write External Storage permission is given but does not seem to help.

I used Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDocuments)
It is deprecated so is that an issue? Is there a newer call that will give me the access I need?

Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alessandro Caliaro 4,196 Reputation points
    2022-06-06T03:32:09.36+00:00

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.