Search code examples
windows-phone-8sd-carddatabase-backups

WP8 development: how to backup a local file (SQLite database) without a webservice?


I need to give the user the option to copy the current state of a local SQLite database created by my WP8 app. I don't have a webservice where the user could upload this database to.

Apparently Microsoft doesn't allow WP8 apps to write to the device's SD card. I then thought about sending the database by email as an attachment, but it also doesn't seem possible.

Any other suggestions? If anybody without a webservice have ever been to this situation: did you find any solution?


Solution

  • Email is a no go if you're using the built in EmailTask. It will not let you attach a file, plus it is not a silent operation. See here: EmailComposeTask

    You can write to the SD CARD -- you just need to setup your application permissions correctly.

    See here for more information: Can I write file on SD Card. You need to setup the capabilities in your manifest file as well as registers the files extension that you want to read/write before you can do anything on the SD Card.


    Another option is have them write to their OneDrive account, a lot of popular apps have this option (like the Mic Recorder app).