/* * (non-Javadoc) * @see android.app.Activity#onCreate(android.os.Bundle) */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Loading the SQLCipher libraries SQLiteDatabase.loadLibs(this); // Preparing the database directories and file to be opened File databaseFile = getDatabasePath(DB_NAME); databaseFile.mkdirs(); databaseFile.delete(); // Opening or Creating the database with our specified password database = SQLiteDatabase.openOrCreateDatabase(databaseFile, DB_PASSWORD, null); // Making a progress dialog so we can see that the database is still being loaded progressDialog = new ProgressDialog(this); progressDialog.setCancelable(false); progressDialog.setMessage("Creating database"); progressDialog.show(); /* * Creating the database from the .sqlite file. We do this in * an AsyncTask so that we aren't locking the UI thread. */ new CreateDatabaseFromFileTask().execute(); }
private DBOpenHelper(Context context) { super(context, DB_NAME, null, DB_VERSION); SQLiteDatabase.loadLibs(context); Log.i("DBOpenHelper:DBOpenHelper", DB_NAME + "/" + DB_VERSION); }