Java tutorial
//package com.java2s; //License from project: Apache License import android.util.Base64; public class Main { /** * Encodes input string to Base64 * * @param input Input string * @return Base64 string */ public static String toBase64(String input) { String base64Str = Base64.encodeToString(input.getBytes(), Base64.NO_WRAP); return base64Str; } }