How can I retrieve the image from database using json encode to android studio? I don't know if it is the correct format for saving the image that can retrieve using android.
$qrlink = "https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=1"
$qrimage = addslashes(file_get_contents($qrlink));
Using addslashes(file_get_contents())
, I can retrieve this image using html <img src="data:image/jpeg;base64,'.base64_encode()
But in json_encode
and decode
to android studio is not working.
byte[] decodedString = Base64.decode(encodedImage, Base64.DEFAULT);
What is the best way to save the image that can retrieve/fetch using json_encode response w/ android studio?