Sebastian Sebastian - 10 months ago 86
JSON Question

Binary data in cursor android

I am saving a bitmap value in

by encoding it into
. 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

How can I resolve this?

Answer Source

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