2

I am trying to save some documents/Images and files in sqlite database. The documents contain different types of pdf,.doc etc files and different format images. Now once I stored it in the blob format, I want to do a backup of the database to sdCard. I however want this backup to be readable only by app for securing the data inside.

Now the question is , for storing different types of files, Do I have to use some sort of other database and for securing. what should I do?

Best Regards

Varsha
  • 560
  • 5
  • 18
Muhammad Umar
  • 11,391
  • 21
  • 91
  • 193

2 Answers2

2

Android's built-in SQLite does not support encryption. Try instead a library like SQLCipher.

CL.
  • 173,858
  • 17
  • 217
  • 259
0

One solution is to use blob and to store the raw data of the file as a column in the db as you are currently doing.

Other solution which I think is better to store the files on the Internal Storage and just store the file paths in the database. Internal storage is private for your application so no one will have access to the files, so your security concerns are taken care of.

see here for how to do this:

Creating folder in internal Memory to save files and retrieve them later

But be aware that can using too much internal storage can make people's phones run out of internal storage and they might decide to delete your app.

Community
  • 1
  • 1
Anup Cowkur
  • 20,443
  • 6
  • 51
  • 84