Convert String in to base64 in Android
byte[] data;
String
str = "xyzstring";
try {
data
= str.getBytes("UTF-8");
String
base64 = Base64.encodeToString(data, Base64.DEFAULT);
Log.i("Base 64
",
base64);
}
catch (UnsupportedEncodingException
e) {
e.printStackTrace();
}
Base 64 of "xyzstring" is “eHl6c3RyaW5n”
--------------------------------------------------------------------------------Our new android application for EGreeting.Have a look to it.
The Greetings Android Application
NovaRadix Android Application Development Team NovaRadix Technology WWW.NOVARADIX.COM