【问题标题】:Google maps android api autocomplete谷歌地图 android api 自动完成
【发布时间】:2014-02-07 11:01:45
【问题描述】:

我按照这个示例为我的 Android 应用程序实现了来自 google 的自动完成功能。 https://developers.google.com/places/training/autocomplete-android

但从 JSON 响应中我得到以下信息:

02-07 12:53:31.202: D/JSON String(6815): {
02-07 12:53:31.202: D/JSON String(6815):    "predictions" : [],
02-07 12:53:31.202: D/JSON String(6815):    "status" : "REQUEST_DENIED"
02-07 12:53:31.202: D/JSON String(6815): }

我知道我的API_KEY 是对的,因为在同一个活动中,我实施了谷歌地图,它工作正常。有什么想法吗?

解决方案:

您需要使用 API 控制台中的Key for browser apps (with referers),而不是 Android 应用程序!

【问题讨论】:

  • 你在谷歌开发者控制台中的项目中添加了places api吗?

标签: android google-places-api


【解决方案1】:

对于 Places API,即使您在 Android 应用程序中实现此功能,您也需要从 API 控制台为浏览器应用程序使用 Key!

【讨论】:

  • 但是 REFERERS url 是什么?
猜你喜欢
  • 2016-11-17
  • 1970-01-01
  • 1970-01-01
  • 2023-01-31
  • 2014-11-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多