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.

Noman Saeed
  • 1,241
  • 2
  • 8
  • 3
  • http://stackoverflow.com/questions/3211156/how-to-convert-image-to-byte-array-in-java – Arpit Feb 25 '13 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])? – wmorrison365 Feb 25 '13 at 10:23

1 Answers1

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

Anurag Shukla
  • 195
  • 2
  • 6