Android Convert Png To Base64 String
. Instead you should do. The problem is that you are returning the toString of the call to Base64encodeBase64bytes which returns a byte array.So what you get in the end is the default string representation of a byte array which corresponds to the output you get. The problem is that dataimagepngbase64 is included in the encoded contents. Remove that data in the function before decoding the string like so.
The problem is that dataimagepngbase64 is included in the encoded contents.
This will result in invalid image data when the base64 function decodes it. Instead you should do. So what you get in the end is the default string representation of a byte array which corresponds to the output you get. The problem is that you are returning the toString of the call to Base64encodeBase64bytes which returns a byte array.