Java tutorial
//package com.java2s; import android.graphics.Bitmap; import android.util.Base64; import java.nio.ByteBuffer; public class Main { public static String convertBitmapToBase64(Bitmap bitmap) { final int size = bitmap.getByteCount(); ByteBuffer dst = ByteBuffer.allocate(size); bitmap.copyPixelsToBuffer(dst); return Base64.encodeToString(dst.array(), Base64.DEFAULT); } }