Android 从GooglePlacesAPI检索图像
我正在使用Google Places api获取位置数据:Android 从GooglePlacesAPI检索图像,android,google-places-api,Android,Google Places Api,我正在使用Google Places api获取位置数据: https://maps.googleapis.com/maps/api/place/search/json? + "location=" + strlatitude + "," + strlongitude + "&" +"radius=" + searchRadius + "&" +"types="+ types + "&" + "sensor=true" + "&" + "key=" + googl
https://maps.googleapis.com/maps/api/place/search/json? + "location=" + strlatitude + "," + strlongitude + "&" +"radius=" + searchRadius + "&" +"types="+ types + "&" + "sensor=true" + "&" + "key=" + googleAPIKey;
我只是从这个回复中得到了唯一的“图标”,但我想得到那个地方的图片
是否有任何参数可以获取这些地方的图像
此外,我如何获得这些地方的评论(如9reviews、6reviews等)您可以使用
JSONObject
获得image\u链接,并且您可以使用Bitmap
轻松地将特定链接转换为图像
例如,从Json
获取image\u链接
:
JSONObject jsonObj = new JSONObject(Global.JSON.toString());
// Creating JSON Parser instance
JSONArray jr=jsonObj.getJSONArray("results");
for(int h=0;h<jr.length();h++)
{
JSONObject js=jr.getJSONObject(h);
icon_array=js.getString("icon");
}
我找到了从places Api获取位置图像的链接
尝试此链接
在上面的链接中,您会看到这样的图像
参考链接
我获得了“图标”,但我如何才能获得特定的图像place@David,你能回答这个问题吗?我不知道位置图片。谷歌只在他们的Json中提供图标图片。没关系,那么评论的概念呢
url = new URL("http://www.paho.org/Images/DD/PIN/whd08_banner2_eng.jpg");
//In URL pass your link
bmp = BitmapFactory.decodeStream(url.openConnection().getInputStream());
image_view.setImageBitmap(bm);