Search code examples
c#androidxamlxamarinmaui

get absolute file path on android .net MAUI


how to get the absolute path of a file on android? the file picker only gives you the cached path of that file which is useless. i don't want to have to copy the file using OpenReadAsync which could lead to app data getting bigger than necessary .is there anyway?


Solution

  • This seems to be a bug with the MAUI essentials API as Android introduced a new permission that should allow applications direct access to file stores if they need it and the user allows the application to do so. However, even with the permission given to the application, the essentials API does not attempt a direct read / write.

    Check out and track the issue here: https://github.com/dotnet/maui/issues/6015

    I've also posted a work around in the issue comments in the mean time, until this is addressed.