'SQLite Xamarin/.net Maui database location that sticks around after update/reinstall

I have been trying to find a location to store my app database that I can find in the file browser on my android emulator. Also with my current set up after I reinstall the app the database is wiped. I want to make it easy for users to be able to transfer their database to a new phone and have it resilient to updates/reinstalls.

Like most of the solutions I've seen I've been saving to the SpecialFolder.Personal location.

Currently I have:

string dbName = "AppStuff.db";
string folderPath = stem.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
string fullPath = Path.Combine(folderPath, dbName);

I have came across a lot of SpecialFolder.MyDocuments (isn't that the same as Personal?) Any suggestions?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source