Using MonoDroid in Visual Studio and an emulator, I am trying to copy a asset, “db.sqlite” from the assets folder to the SD card so that I can open the database for read/write.
When I run the app, it dies. MonoDroid is not giving me any debug info.
string destPath = Path.Combine(Environment.GetFolderPath(
Environment.SpecialFolder.Personal), "db.sqlite");
if (!File.Exists(destPath))
using (Stream stream = Assets.Open("db.sqlite"))
{
stream.CopyTo(File.Create(destPath));
stream.Close();
}
Check the Android Debug Log:
http://android.xamarin.com/Documentation/Guides/Android_Debug_Log