android - Facing Issue when downloading image in byte array from webservice and displaying it -
I'm trying to get an image from the webservice as a byte array and then it changes the byte array to the screen I'm displaying bitmap at zero value. Can someone help me how to proceed
public string final output (string response) {string status = zero; Try {JSONObject parse = new JSONObject (feedback); JSONObject registerParse = (JSONObject) parsing Get ("BusinessSearches"); Status = Register Parse.get ("Image"). ToString (); Byte [] theByteArray = status.getBytes (); System.out.println ("The Betrayer" + The Bitterayer); Bitmap bitmap 1 = bitmapfender Acadabiteurere (Betaare, 0, Betaarere.Lamp); System.out.println ("bitmap" + bitmap 1); ApplicationConstant.bitmapValue = bitmap1; } Hold (exception e) {System.out.println ("Error :::::" + e.getMessage ()); } Return status; }
You can not create a bitmap directly from encoded imaging, firstly you need to base it on base 64 decoding And then generate a bitmap like this:
public string final output (string response) {string status = zero; {JSONObject parse = Try new JSONObject (feedback); JSONObject registerParse = (JSONObject) parse.get ("Business Search"); Status = register Parsse.getString ("image"); Byte [] Decode String = Base 64 Decode (Position, Base 64. DEFAULT); Bitmap decodedbie = bitmapficht. Decodbiteare (decoded string, 0, decoded string; Lang); ApplicationConstant.bitmapValue = bitmap1; } Hold (exception e) {System.out.println ("Error :::::" + e.getMessage ()); } Return status; }
Comments
Post a Comment