|I have an existing sqlite database in the android project under Assets.
I use the following to copy the database to the application personal folder
public async Task<string> GetDBPathAndCreateIfNotExists()
string databaseName = "DBQDive.db3";
var docFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
var dbFile = Path.Combine(docFolder, databaseName);
FileStream writeStream = new FileStream(dbFile, FileMode.OpenOrCreate, FileAccess.Write);
The problem is that even after uninstalling the app from the phone
if (!File.Exists(dbFile)) ALWAYS find a database file and therefore never copies the new database because the database has been created by a previous installation.
How can I detect if this is the first time the app is run so I can delete the database before it should be copied over?
Never underestimate the power of human stupidity -
I'm old. I know stuff - JSOP