Java tutorial
//package com.java2s; //License from project: Open Source License import android.util.Base64; import java.io.UnsupportedEncodingException; public class Main { public static String generateBase64String(String inString) throws UnsupportedEncodingException { byte[] byteTransform = inString.getBytes("UTF-8"); return Base64.encodeToString(byteTransform, Base64.NO_WRAP); } }