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

谁说胖子不能爱 提交于 2019-12-10 01:59:15

问题


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?


回答1:


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.




回答2:


Look at this link at android developers 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.



来源:https://stackoverflow.com/questions/36112984/is-the-map-api-key-and-google-places-api-the-same

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!