地图 Api 键和 Google 地点 Api 是否相同?

Is the Map Api Key and Google Places Api the same?

我希望我不会得到反对票,英语不是我的第一语言,这就是为什么我对 api 文档感到困惑。如果我需要为 "Google Maps Android API" 和 "Google Places API for Android"

生成不同的 api 密钥,我会感到困惑

我问是因为我使用 google 地图 android api 从我的 android 应用程序成功渲染地图但是当我尝试使用官方代码时google android places api 示例 (PLACE PICKER) 它在没有抛出任何错误的情况下失败了。它正确地呈现 activity 但是当我单击查找位置按钮时它只是 returns 我到我以前的 activity 而没有错误。我猜这可能是一个 api 关键问题,这就是为什么我问我是否需要两个不同的 api 密钥?

不,每个服务(Google Maps V2 API 和 Google Places API)都有并将生成不同的 API 密钥。 但是您不能同时 use/declare 清单中的两个键。当您使用 Google 地图和 Google 地点时,只需使用 Google 地点 API 键 (com.google.android.geo.API_KEY),它对两者都有效。

看看这个 link 在 android 开发者那里 https://developers.google.com/places/android-api/signup#release-cert

You need an Android API key, not a browser key. You can use the same API key for your Google Maps Android API v2 apps and your Google Places API for Android apps.