I am using an API that returns a String for the URL of a photo. It is in a strange format, however, and it is causing me issues downloading the images using Volley (or any other method for that matter).
My code looks like this:
imageview = (ImageView) findViewById(R.id.imageView);
String web_url = "http:\\/\\/static.giantbomb.com\\/uploads\\/square_avatar\\/8\\/87790\\/1814630-box_ff7.png";
String web_url2 = "http://www.finalfantasyviipc.com/images/media_cloud_big.jpg";
ImageRequest ir = new ImageRequest(web_url2, new Response.Listener<Bitmap>() {
@Override
public void onResponse(Bitmap response) {
imageview.setImageBitmap(response);
Log.d("image was ", "set");
}
public void onErrorResponse(VolleyError error) {
Toast.makeText(getApplicationContext(), "ERROR: " + error.getMessage(), Toast.LENGTH_SHORT).show();
Log.d("ERROR", error.getMessage());
}
}, 0, 0, null, null);
requestQueue.add(ir);
As you can see, the second URL works fine, but the first URL, the one with the many backward and forward slashes, will not return an image. You can copy both into your browser and they work fine, but the first one cannot be read by my Android parsing. Does anyone have any recommendations of how to get an image from the first link? Nearly everything I have tried utilizes Strings, which seems to be a core part of the problem.
Thanks for your help!
-Sil