gpt4 book ai didi

android - Google Places API 不会通过 Android 中的照片引用返回照片

转载 作者:行者123 更新时间:2023-11-29 15:42:10 24 4
gpt4 key购买 nike

我正在使用 Google places API 获取特定餐厅的详细信息。现在,我希望在我的 android 应用程序中显示餐厅的图像。为此,我提到了this .但是,出现错误所需的以下链接会给我一个 500 错误,当我在链接中使用 http:// 而不是 https:// 时,它给出一张图片,表明您已超出 API 限制。

我正在使用 Gl enter link description here ide 来显示这些图像。我认为 Glide 没有任何问题。生成的 url 不提供任何输出。

代码如下:

    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);

这是一个 example带有 https 协议(protocol)的 restaurantpic URL 给出 500 错误。与HTTP协议(protocol)相同,下附enter image description here图像(用于配额填充)。

最佳答案

伙计们,使用 JSON 数据中的“引用”字段而不是“照片引用”字段是我的愚蠢错误。

问题已解决。

关于android - Google Places API 不会通过 Android 中的照片引用返回照片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38557560/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com