谷歌的地方API密钥的Andr​​oid应用 [英] Google Places API Key for Android App

查看:154
本文介绍了谷歌的地方API密钥的Andr​​oid应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了我的Andr​​oid应用程序的 API密钥(for Android应用程序)。它要求谷歌地图API。但是,现在相同的密钥将不适用于谷歌API的地方工作。

I have created an API Key (for Android apps) for my Android Application. It was required by google maps API. But now the same key won't work for Google Places API.

我也试过打与以下网址浏览器:

I also tried hitting the browser with the following URL:

<一个href="https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=my_key">https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=my_key

我得到:

{
   "error_message" : "This IP, site or mobile application is not authorized to use this API key.",
   "html_attributions" : [],
   "status" : "REQUEST_DENIED"
}

当我用Google搜索的答案,我发现这一点:

When I googled for an answer, I found this:

<一个href="https://developers.google.com/places/training/autocomplete-android">https://developers.google.com/places/training/autocomplete-android

什么类型的API密钥?

What type of API key?

您需要您自己的浏览器或服务器API密钥谷歌API的地方,然后才能开始使用地点Autcomplete服务。需要注意的是一个Android API密钥不会为商家信息自动填充服务工作。

You'll need your own browser or server API key for the Google Places API before you can begin using the Place Autcomplete service. Note that an Android API key will not work for the Place Autocomplete service.

这让我困惑,我没有任何URL的Web应用程序,也没有任何服务器的IP。因此,我很困惑如何让任何一个浏览器键服务器密钥

This got me confused as I do not have any URL for a web app, nor any server IP. Therefore I am confused on how to get either a Browser key or a Server key

任何人都可以请帮我找出什么在这里需要排序键的?另外,如果我要创建一个浏览器键服务器密钥,我该怎么办呢?

Could anyone please help me in figuring out what sort of key is needed here? Also if I have to create a Browser key or a Server key, how can I do so?

推荐答案

文档知道如何获得谷歌的地方API密钥

see this doc to know how to obtain google places API key

查看<一个href="http://$c$c.tutsplus.com/tutorials/android-sdk-working-with-google-maps-google-places-integration--mobile-16054"相对=nofollow>这个的教程整合谷歌的地方

Check out this tutorial for integrating Google places

这篇关于谷歌的地方API密钥的Andr​​oid应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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