0

I am an amateur, trying to write an app that uses a sqlite database. I want the app to have read/write access to the Documents folder on my Android phone. However, I am having trouble with read/write permissions.

I created a very simple app, based on the Visual Studio .NET Maui template. I set READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE as required permissions in the Android manifest, and I sought permissions using Permissions.RequestAsyc<Permissions.StorageWrite>. Running it on an Android 14.0 emulator, that gave me write access to the Documents folder - I could use File.Copy() to copy a file to it.

I then installed sqlite-net-pcl, using the NuGet Package Manager, and did nothing else. I could no longer write to the Documents folder, and the App info on the emulator told me that I had permission to access "Music and audio and Photos and videos" (but not other files).

What am I missing?

4
  • Did you try to uninstall the sqlite-net-pcl package and test it again? Will it still can not get the file? Commented Feb 28, 2024 at 3:22
  • Yes, access to Documents returns if I uninstall the sqlite-net-pcl package, and it goes again if I reinstall it. I get the same with Microsoft.Data.Sqlite. Commented Feb 28, 2024 at 10:40
  • This is the third party NuGet package. You can ask the developer about this issue on the GitHub and follow it up. Commented Feb 29, 2024 at 8:54
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Mar 3, 2024 at 12:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.