I'm experimenting with a SQLite database to hold logging information from a messaging app.
I'm using SQLiteOpenHelper and forcing the db onto the SD card of an unrooted device using:
public LogDatabase(Context context, String dbname) {
super(context,
Environment.getExternalStorageDirectory().getAbsolutePath() +
"/" + dbname, null, 3);
}
This appears to work fine: the database grows appropriately and the app doesn't throw any exceptions when writing to it.
The problem arises when I USB-mount the device and try to open the database from an external app (for example, sqlite3 from an Ubuntu command line). The error is always the same: "Error: file is encrypted or is not a database".
Is there something hinky about Android's treatment of SQLite? Or am I missing something fundamentally broken about the way I'm managing the db?
Edit: The original device in question is a HTC Desire S running v2.3.5.
Edit: I've re-run the test on an alternative device (Motorola ET1 running v2.3.4) and the problem does not occur. I can mount the device via Ubuntu and browse the database at will via the sqlite3 command line.