简体   繁体   English

Android Google Places API返回请求被拒绝

[英]Android google places api return request denied

In my Android project I am using Google map v2 and its working. 在我的Android项目中,我正在使用Google map v2及其工作方式。 As a change request I need to include search places in AutoCompleteTextview. 作为更改请求,我需要在AutoCompleteTextview中包括搜索位置。

I did the following steps to get map in Google console.
1) I have registered app.
2) Placed SHA1 key and generated Android key.
3) And made all procedure and get map.

Now I include Google places search in an auto complete textview.
1) go to the project enabled places api in the service pane. (picture 1)
2) I give sample company name and web site url (http://www.google.com). (picture 2)
3) now I get browser key and used it in app. (picture 3)

what key need to use (browser key or android app key). 需要使用什么键(浏览器键或android应用程序键)。 I have used both. 我都用过。

But I got Request Denied Exception. 但是我收到了请求被拒绝的异常。 I hope I made all things are correct. 我希望我所做的一切都是正确的。

I have referred sample from the site . 我已经从现场转介了样品。

screen snaps: 屏幕快照:

在此处输入图片说明

after that: 之后:

在此处输入图片说明

在此处输入图片说明

我通过使用Server key而不是浏览器密钥解决了该问题。

只需在键值之前添加key =即可。您的键应为“ key = AIzaSyAVQJO-cp6RcEVUJ-6Yb_b”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM