How to convert the json image url string into Bitmap image to display images in android application

Use Volley‘s ImageRequest, to update your ImageView via JSON image URL.

ImageRequest imageRequest = new ImageRequest(image_url_coming_from_json, new Response.Listener<Bitmap>() {
            @Override
            public void onResponse(final Bitmap response) {

                        your_imageView.setImageBitmap(response);
            }
        }, 0, 0, ImageView.ScaleType.CENTER_INSIDE, null, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                Toast.makeText(your_activity.this, error.toString(), Toast.LENGTH_LONG).show();
            }
        });

        RequestQueue requestQueue = Volley.newRequestQueue(your_activity.this);
        requestQueue.add(imageRequest);

Leave a Comment