-1

I am trying to call the Google places API in my android app, using the following : https://maps.googleapis.com/maps/api/place/textsearch/xml?query=restaurants+in+Sydney&sensor=true&key=AddYourOwnKeyHere

I have tried using a debug key, and have even tried generating a private key, but all I get is the REQUEST_DENIED response.

I have followed the steps mentioned for generating an Android API key, but still the error.

What am I missing? Is there a definitive guide I can use for using google places api in my android app?

Your suggestions would be highly appreciated.

ufdeveloper
  • 387
  • 6
  • 19

3 Answers3

5

You are using Android key for google Place API.
Login on google console then create a Place API key, try again. enter image description here enter image description here

Tai Dao
  • 3,407
  • 7
  • 31
  • 54
3
  1. Delete old api project from api console.
  2. Create a new project.
  3. Start only the google places api service.
  4. Clicked the try it out link 5 .use the default key it had made.
  5. Copied the key from the url field and Use it in app.
Sagar Maiyad
  • 12,655
  • 9
  • 63
  • 99
1

In google console, in services tab, have you switched on google maps? Reference: https://developers.google.com/maps/documentation/javascript/tutorial#api_key https://developers.google.com/places/documentation/

vasanth
  • 715
  • 10
  • 23