I'm integrating SQLCipher in a application with a SQLite Db. when the app is launch, I receive a "application has stopped unexpectedly" error. When I look at LogCat I see the initial error is "CREATE TABLE android_metadata failed". The only change I have made to this application is adding the code to integrate SQLCIpher. I'm sure I have not coded it properly but am not sure what i missed. the following has been done:
1.java.io.file, info,guardianproject.database.sqlcipher.SQLiteDatabase, android.os.Bundle, and android.app.activity have been imported. 2. InitializeSQLCipher() has been added to the onCreate method of the splash activity
private void InitializeSQLCipher() {
SQLiteDatabase.loadLibs(this);
File databaseFile = getDatabasePath ("mydatabase.db");
databaseFile.mkdirs();
databaseFile.delete();
SQLiteDatabase database = SQLiteDatabase.openOrCreateDatabase(databaseFile, "password", null);
database.execSQL("create table t1(a, b)");
database.execSQL("insert into t1(a, b) values(?, ?)", new Object[]{"one for the money", "two for the show"});
}