1

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

Rohit
  • 3,401
  • 4
  • 33
  • 60

1 Answers1

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.

Community
  • 1
  • 1
Aravin
  • 4,126
  • 1
  • 23
  • 39
  • no, dnt show any error, only shows blank, in debugging i have check result come – Rohit Sep 04 '13 at 11:01
  • Uninstall the project in your device and clean the project try now. – Aravin Sep 04 '13 at 11:01
  • Check are you added the above permissions. – Aravin Sep 04 '13 at 11:07
  • sounds like interesting..i got same but i forget what i did here ...find and inform. – Aravin Sep 04 '13 at 11:10
  • sir please, bhut mushkil naal meri keys chal rahihan hn, problem map di hai , keys ok hn hun – Rohit Sep 04 '13 at 11:14
  • Because i did same your wish....refer this http://stackoverflow.com/questions/14048381/google-maps-api-v2-shows-blank-map http://stackoverflow.com/questions/5763789/google-map-displaying-only-blank-tiles-android – Aravin Sep 04 '13 at 11:20
  • @Rohit i don't know hindi can you explain what you put in your comment...are you scolding or praising...... lol....just fun.. – Aravin Sep 04 '13 at 11:21
  • i have changed key but again same problem – Rohit Sep 04 '13 at 11:23
  • On generating browser key, you can keep the url referer field as blank. – Aravin Sep 04 '13 at 11:25
  • I think still the problem is key only you need to put the right key for manifest and main activity. – Aravin Sep 04 '13 at 11:35
  • Please ensure the following : Browser API Key : This is the key obtained in the class MainActivity. Android API Key : This is the key obtained use it in AndroidManifest.xml – Aravin Sep 04 '13 at 11:35
  • android for menifest and browser key for class file – Rohit Sep 04 '13 at 11:38
  • https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=30.6535515,76.8207302&radius=5000&types=airport&sensor=true&key=AIzaSyDhdaUpTdkBUCqr9x38wi01cU_SplC8ZD4 . this is my url – Rohit Sep 04 '13 at 11:40
  • make sure that your "user-permission" tags are outside – Aravin Sep 04 '13 at 11:41
  • refer this http://android-er.blogspot.in/2012/12/google-maps-android-api-v2-with-blank.html – Aravin Sep 04 '13 at 11:42
  • 09-04 17:16:11.424: I/Google Maps Android API(5669): Failed to contact Google servers. Another attempt will be made when connectivity is established. – Rohit Sep 04 '13 at 11:46
  • can you show your google api console services. In your question dashboard part. – Aravin Sep 04 '13 at 11:47
  • enavle v2 instead of v3. – Aravin Sep 04 '13 at 11:51
  • If you are using WIFI means you also need the android.permission.ACCESS_WIFI_STATE in the manifest Don't know if it was just a case or it's a general thing – Aravin Sep 04 '13 at 11:57
  • sir i have uninstall and reinstall but now left only to do restart eclipse – Rohit Sep 04 '13 at 12:05
  • help please , not working , i have restarted eclipse and reinstall app – Rohit Sep 04 '13 at 12:21
  • rohit@antheminfotech.com – Rohit Sep 04 '13 at 12:27
  • i have replace only menifest key now – Rohit Sep 04 '13 at 12:40
  • 09-04 18:13:24.764: E/AndroidRuntime(8115): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable – Rohit Sep 04 '13 at 12:43
  • If found anything i will inform ok. – Aravin Sep 04 '13 at 13:28
  • I solved the same problem here refer this ....http://stackoverflow.com/questions/18618409/android-map-is-plain-white-screen-no-errors.. – Aravin Sep 04 '13 at 16:24
  • how this help me , wait i send u my full code, and please tell me whr m wrong – Rohit Sep 05 '13 at 05:24
  • on my end this app is also not running http://wptrafficanalyzer.in/blog/showing-current-location-using-onmylocationchangelistener-in-google-map-android-api-v2/ – Rohit Sep 05 '13 at 05:37
  • your keys are the problem in manifest and mainactivity you are using the same key. Yesterday itself i told to change the keys man. – Aravin Sep 05 '13 at 06:00
  • bro i have changed, for testing now i was change it now – Rohit Sep 05 '13 at 06:05
  • please check in sdk are you install the google play services or not – Aravin Sep 05 '13 at 06:06
  • i have send you one more snapshot in mail – Rohit Sep 05 '13 at 06:09