android database protect

slowtime

Active Member
Licensed User
Longtime User
I'm new on A4ppc. How can I protect data in sql database in android. If doesn't exist a native statement, please, can you post an example ?
Thank you.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can save the database in the internal storage. It will only be accessible to your application (on unrooted devices).

For stronger encryption you will need to encrypt the data itself. You can use the agraham's Encryption library: Basic4android - Encryption
However you should consider what to do with the password. If it is stored as a string in your code then a hacker can find it and decrypt your database.

I'm not sure about your use case, but if it is possible it is usually recommended to ask the user to supply the password.
 
Upvote 0

slowtime

Active Member
Licensed User
Longtime User
Thank you.
I'd like to write a password safe application, but sql database do not accept bytes data (cipher dll).
Thank you again.
 
Upvote 0
Top