Map Api Key和Google Places Api是否一样? [英] Is the Map Api Key and Google Places Api the same?

查看:101
本文介绍了Map Api Key和Google Places Api是否一样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我不会得到一个投票,英文不是我的第一语言,这就是为什么我被api文档弄糊涂了。我很困惑,如果我需要为Google Maps Android API和Google Places API for Android生成不同的API密钥



我在问,因为我成功地呈现地图从我的Android应用程序使用谷歌地图android api,但是当我尝试使用官方谷歌android的代码放置api示例(PLACE PICKER)的代码时,它失败了,没有抛出任何错误。它正确地呈现活动,但是当我点击查找地点按钮时,它只是将我返回到以前的活动,没有任何错误。我猜这可能是一个API关键问题,这就是为什么我问我是否需要两个不同的api键吗?

>不,每项服务(Google Maps V2 API和Google Places API)都有一个并且会生成不同的API密钥。
但是你不能同时在清单中使用/声明两个键。当您使用Google地图和Google地方信息时,只能使用Google Places API密钥(com.google.android.geo.API_KEY),并且它可以同时使用。


I hope I don't get a down vote, English is not my first language that is why I get confused by api documentations. I am confused if I need to generate different api keys for "Google Maps Android API" and "Google Places API for Android"

I am asking because I am sucessfully rendering maps from my android app using google maps android api but when I try the using the code of the official google android places api example (PLACE PICKER) it is failing without throwing any errors. It renders the activity properly but when I click the find places button it just returns me to my previous activity with no error. I am guessing it might be an api key issue that is why I am asking if I need two different api keys for this?

解决方案

No, each service (Google Maps V2 API and Google Places API) have a and will generate a different API Key. But you can't use/declare both keys in your manifest in the same time. When you are using Google Maps and Google Places just use the Google Places API key only (com.google.android.geo.API_KEY), and it will work for both.

这篇关于Map Api Key和Google Places Api是否一样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆