protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); ShareActivityContext = this; // HACK: for SpeakButtonRenderer to get an Activity/Context reference Xamarin.Forms.Forms.Init (this, bundle); //Xamarin.QuickUIMaps.Init (this, bundle); var sqliteFilename = "EvolveSQLite.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(Evolve13.Resource.Raw.EvolveSQLite); // RESOURCE NAME ### // create a write stream FileStream writeStream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write); // write to the stream ReadWriteStream(s, writeStream); } var conn = new SQLite.SQLiteConnection(path); // Set the database connection string App.SetDatabaseConnection (conn); SetPage (App.GetMainPage ()); }