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 bitmapToBase64String(Bitmap bm) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.JPEG, 80, bos); byte[] b = bos.toByteArray(); return Base64.encodeToString(b, Base64.DEFAULT); } }