Here you can find the source of encodedBase64(String currentString)
public static String encodedBase64(String currentString)
//package com.java2s; import java.io.UnsupportedEncodingException; import android.util.Base64; public class Main { public static String encodedBase64(String currentString) { byte[] commentData = null; try {//from w ww . j a v a2 s. co m commentData = currentString.trim().getBytes("UTF-8"); } catch (UnsupportedEncodingException e1) { e1.printStackTrace(); } String b = Base64.encodeToString(commentData, Base64.NO_WRAP); return b; } }