I have been searching for almost a day now and this matter is driving me crazy.
I am trying to open a connection to a SQLite DB I push to the device from windows.
The database now is inside this path:
Phone/Android/data/MyApp.Droid/files/MyDB.db3
which can be read without 'Phone/Android' I think.
When I try to make a connection to the DB I can't seem to find the path.
Here's my code for retrieving the path and creating the connection.
public SQLite.SQLiteConnection GetConnection()
{
var sqliteFile = "MyDB.db3";
var dataPath = global::Android.OS.Environment.DataDirectory.AbsolutePath;
var dataPathExtension = @"MyApp.Droid/files";
var destination = Path.Combine(dataPath, dataPathExtension, sqliteFile);
//this outputs the following: /data/MyApp.Droid/files/MyDB.db3
//When I check my phone this is exactly when I can find the file.
return new SQLite.SQliteConnection(destination);
//It can't find the path/file.
}
The DB needs to be in a location I can access from windows without rooting the device.
Can anyone explain to me why it can not find the path/file and if possible tell me how I can read the location?
Note: I cannot access any 'Environment.SpecialFolder' from windows it seems as this gives me a path like: data/user/0/MyApp.Droid/files/
Yours,