I am using Google places API to get the details of particular restaurant.
Now, I wish to display the image of the restaurant in my android app .
For that, I referred this .
However, the below link which is required to get an error gives me a 500 error and when I use http://
in the link instead of https://
, it gives an image which says you have exceeded the API limit.
I am using Glenter link description hereide to display these images. I dont think there's any issue with the Glide . The url generated does not gives any output.
Below is the code :
String url = mPlaces.getIcon();
String photoreference = mPlaces.getPhotoreference();
String restaurantpic = "http://maps.googleapis.com/maps/api/place/photo?" +
"maxwidth=400" +
"&photoreference=" +photoreference +
"&key="+API_KEY;
Log.d("Loading restaurantpic" , restaurantpic);
Glide
.with(mContext)
.load(restaurantpic)
.centerCrop()
// .placeholder(R.drawable.loading_spinner)
//.crossFade()
.into(mImageViewIcon);
This is an example of restaurantpic URL with https protocol which gives 500 error. The same with HTTP protocol gives below attached image(Which is for quota filled).
So guys, It was my silly mistake to use "referenece" field from the JSON data instead of "photo-reference" field .
The issue was resolved .