Code tutorial for conversion between String and Bitmap, and conversion between bitmap
Code Conversion between String and Bitmap
/*** Convert a Base64 string to an image ** @ param String * @ return */public static Bitmap stringToBitmap (string) {Bitmap bitmap = null; try {byte [] bitmapArray = Base64.decode (string, Base64.DEFAULT); bitmap = BitmapFactory. decodeByteArray (bitmapArray, 0, bitmapArray. length);} catch (Exception e) {e. printStackTrace ();} return bitmap;}/*** convert the image to a base64 String ** @ param bitmap * @ return */public static String bitmapToString (Bitmap bitmap) {ByteArrayOutputStream baos = new ByteArrayOutputStream (); bitmap. compress (Bitmap. compressFormat. PNG, 100, baos); byte [] imgBytes = baos. toByteArray (); // convert to byte array return Base64.encodeToString (imgBytes, Base64.DEFAULT );}