Java tutorial
//package com.java2s; import android.util.Base64; public class Main { public static String getEncodedBasicAuthenticationString(String details) { return "Basic " + Base64.encode(details.getBytes(), Base64.DEFAULT); } }