-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?

1
  • 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. Commented Nov 11, 2016 at 6:24

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.