I have a web service, which gives me a json having a node named as 'imagedata'. It contains a huge data as a string. When I print this in browser it gives me valid input. Base64 encoded strings ends on '=' character.
I have also tested it using this tag in a html page, and it works perfectly fine.
<img src="data:image/png;base64,MY_BASE64_ENCODED_STRING"/>
Here is my code;
StringBuilder b64 = new StringBuilder(dataObj.getString("imagedata"));
byte[] decodedByte = Base64.decode(b64.toString(), 0);
bitmap = BitmapFactory.decodeByteArray(decodedByte, 0, decodedByte.length);
Kindly note that, This code works on smaller image-data but gives bad-base64 exception on larger image-data
Kindly help me out, Thanks