protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); SpeakingActivityContext = this; // HACK: for SpeakButtonRenderer to get an Activity/Context reference Xamarin.Forms.Forms.Init (this, bundle); var sqliteFilename = "TodoSQLite.db3"; string documentsPath = System.Environment.GetFolderPath (System.Environment.SpecialFolder.Personal); // Documents folder var path = Path.Combine(documentsPath, sqliteFilename); // This is where we copy in the prepopulated database Console.WriteLine (path); if (!File.Exists(path)) { var s = Resources.OpenRawResource(Resource.Raw.TodoSQLite); // RESOURCE NAME ### // create a write stream FileStream writeStream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write); // write to the stream ReadWriteStream(s, writeStream); } var plat = new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid(); var conn = new SQLite.Net.SQLiteConnection(plat, path); // Set the database connection string App.SetDatabaseConnection (conn); SetPage (App.GetMainPage ()); }