Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
218 views
in Technique[技术] by (71.8m points)

android - Google places shows blank

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

enter image description here

and overview is this

enter image description here

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 :

enter image description here

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"/>    

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...