Android Question Why SQLCipher database is bigger and can not be compressed?

susu

Well-Known Member
Licensed User
Longtime User
Hi guys,
I got 2 problems and I want to hear your thought:

1. Based on a SQL database (file size 85MB) I create new SQLCipher database but its size is bigger (90MB). I don't understand why.

2. When I compile with the old SQL database named "data.db" => Result apk file size is only 28MB because the database is compressed. But when I compile with new SQLCipher database named "datacipher.db" => Result apk file size is 93MB! The reason is "datacipher.db" is not compressed and I don't know why too.

Did you face that problems? Please share your idea/solution. Thank you so much.
 

susu

Well-Known Member
Licensed User
Longtime User
1. OK, I got it.
2. Is there a way to handle it? My app is so big for the users.
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
The database is simple with 3 columns: id, text1, text2. Each text have 5,000 - 10,000 words. And total 22,500 records. I need to encrypt it because it's exclusive content.
I tried to encrypt the content then add to database but the result is bigger than SQLCipher database so I really stuck in this problem.
 
Upvote 0

DouglasNYoung

Active Member
Licensed User
Longtime User
Surely the solution is to compile the app with an empty database and when the app first runs download the filled database from a web server. This would also have the advantage of being able to update the system without recompiling a new apk.

Douglas
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User

The problem is with SQL database, my app (apk file) is only 28MB. After encrypt database with SQLCipher it growns up to 90MB (only database file). I don't think the users want to download that huge file.
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
The compressed SQLCipher database is 36MB. It's still quite big but acceptable.

Thank you very much.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…