Does anyone know how to decode and encode a string in Base64 using the Base64. I am using the following code, but it\'s not working.
String source = \"passwo
For API level 26+
String encodedString = Base64.getEncoder().encodeToString(byteArray);
Ref: https://developer.android.com/reference/java/util/Base64.Encoder.html#encodeToString(byte[])