Is there a base-64 decoder and encoder for a String in Android?
Here is a simple method I was going to use until I realized that this is only supported in Android API 8+:
// Has line break
public String getBase64(String input) {
return Base64.encodeToString(input.getBytes(), Base64.DEFAULT);
}
// No line break
public String getBase64(String input) {
return Base64.encodeToString(input.getBytes(), Base64.NO_WRAP);
}