How to load existence sqlcipher db from assets/databases in android studio?


Hi, I created a sqlcipher database. Now i want to put it in asset/databases folder of my android studio project. How can I use this database in my project? I put it in asset/databases but when I use this code it seems that it make an empty database(I mean that the application never used the database that I put in assets folder):

File databaseFile=null;
SQLiteDatabase sq=SQLiteDatabase.openOrCreateDatabase(databaseFile, “kvlhtchvahcshgj,gdn70”, null);

how can I use my existing database?


Hello @Zahra_Tofighi

You will need to extract your database from the assets directory. You might take a look at how that is done within the SQLCipher for Android test suite.