0

AoA. Dear, i need function which can convert an image into binary to store in database and reverse conversion for this binary to image using java.

2
  • stackoverflow.com/questions/3211156/… Commented Feb 25, 2013 at 10:22
  • Not an Android guru or sure of your real needs but, is it not possible to store the file location in your database and just store the image in the filesystem (or, just store the image in a well-known location in your filesystem [or on the classpath])? Commented Feb 25, 2013 at 10:23

1 Answer 1

0

Use Base64 Class to convert it into String and then store in Database. You can convert it back into image whenever it is required.

http://developer.android.com/reference/android/util/Base64.html

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

2 Comments

bad idea ... common solution is to store only path in db and files in (surprise!) file system
why convert to base64 ? what good is that ? what's wrong with storing bytes ?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.