Is there a base-64 decoder and encoder for a String in Android?
If you don't want a line break at the end of the String, change the flags from Base64.DEFAULT to Base64.NO_WRAP
Base64.DEFAULT
Base64.NO_WRAP
Base64.encodeToString("yourString".getBytes("UTF-8"), Base64.NO_WRAP);