-1

I am saving a bitmap value in SQLite by encoding it into base64. I need to create a JSON array for all my SQLite values. I am using a a cursor to get all my values from SQLite.

But the cursor does not hold the whole base64 value, only half base64 bits.

How can I resolve this?

Ramanuj Basu
  • 77
  • 3
  • 15
Sebastian
  • 417
  • 3
  • 13
  • P.S. Ensure that the column of SQLite in which you are storing `base64` encoded string has at least `length` greater than or equal to encoded string length. – Vipul Asri Nov 11 '16 at 06:24

1 Answers1

2

I think its not the best practice to save base64 representation in db:

Please remember base64 encoding makes file sizes roughly 33% larger than their original binary representations, So you can convert image to byte[] and then save it in blob field

To save binary data in JSON Object, please see here

Community
  • 1
  • 1
Muhammad Farhan Habib
  • 1,859
  • 20
  • 23