Java tutorial
//package com.java2s; import android.graphics.Bitmap; import android.util.Base64; import java.io.ByteArrayOutputStream; public class Main { /** * convert (encode) image to string * **/ public static String encodeToBase64(Bitmap image, Bitmap.CompressFormat compressFormat, int quality) { ByteArrayOutputStream byteArrayOS = new ByteArrayOutputStream(); image.compress(compressFormat, quality, byteArrayOS); return Base64.encodeToString(byteArrayOS.toByteArray(), Base64.DEFAULT); } }