Google places shows blank

ε祈祈猫儿з 提交于 2019-12-29 01:51:10

问题


I want to use google places api but this is now working shows me Request_denied in android app and also in browser . please help

following this tutorial for google places http://www.androidhive.info/2012/08/android-working-with-google-places-and-maps-tutorial/

{
"debug_info" : [],
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
}

i have generated key as following

and overview is this

and using this for testing

https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=5000&types=food&name=harbour&sensor=false&key=AIzaSyBLW2RsxQuoZme-oy2t6ebRI7qyaOtMJq0

EDIT :

my permissions

<permission
    android:name="com.antheminfotech.locationnearby.permission.MAPS_RECEIVE"
    android:protectionLevel="signature"/>

<uses-permission android:name="com.antheminfotech.locationnearby.permission.MAPS_RECEIVE"/>

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true"/>    


回答1:


Create a new project in google api provide the details like name and you package name and your sha1 key then click android in that. After that it show new key there you find generate new keys(browser,server,android) you can create the keys for both browser and android.

First enable the following services in google Api console

1.Google Maps API v2

2.Places API

3.Analytics API

<uses-permission android:name="(YourPackageName).permission.MAPS_RECEIVE"/>

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

add this also

    <uses-feature
    android:glEsVersion="0x00020000"
    android:required="true"/>  

Any problem to this let me know.



来源:https://stackoverflow.com/questions/18609772/google-places-shows-blank

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