Java tutorial
//package com.java2s; //License from project: Apache License import android.graphics.Bitmap; import android.util.Base64; import java.io.ByteArrayOutputStream; public class Main { public static String bitmapToString(Bitmap bm, int rate) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.JPEG, rate, baos); byte[] b = baos.toByteArray(); return Base64.encodeToString(b, Base64.DEFAULT); } }