Java tutorial
//package com.java2s; import java.io.ByteArrayOutputStream; import android.graphics.Bitmap; import android.util.Base64; public class Main { public static String bitmapToBase64(Bitmap bm) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.PNG, 100, baos); //bm is the bitmap object byte[] b = baos.toByteArray(); return Base64.encodeToString(b, Base64.DEFAULT); } }