mardi 11 août 2015

Backup of an in-memory SQLiteDatabase to a file

I currently have an in-memory SQLiteDatabase created using SQLiteDatabase.create(null). At a later point in time, I wish to backup this database to a file.

This is well-documented for the C SQLite API. Essentially, I would like to reproduce the functionality of the loadOrSaveDb function, but it doesn't seem that the sqlite3_backup functions are available in the Android SQLite API.

If this is not directly possible through an equivalent to the C backup APIs, is there a straightforward way to comprehensively copy the contents of an in-memory SQLiteDatabase to a file-based one?

(This is essentially the same question as Backup and restore sqlite from disk to memory in Java, but with Android SQLite rather than JDBC.)

Aucun commentaire:

Enregistrer un commentaire