0

Ok, so, maybe I just do not understand the Google Places API, or maybe I have been failing miserably with following tutorials, but either way, I could definitely use some help.

I am making an android application where a screen zooms into where they are located and uses google places to search for a hard-coded String place. (IE, you live in Los Angeles, California; the closest McDonald's to you is located here *). And then it would display the spot on the map.

When I follow every single tutorial I have found to get an API key for Google places, (IE: https://www.youtube.com/watch?v=8PVK1Ue5rvk) it says I need to enter a web address to obtain one (See pictures below) Picture 1

-----(Gap inbetween photos)-------------------------------------------------

Picture 2

-- But I do not have a website or URL to put here as I am just writing this for my android device. Do I need to get a website host URL in order to use this? Is there a generalized URL we are supposed to use that I have not heard of? Am I doing this entirely the wrong way?

I also copied and pasted code from here: http://www.androidhive.info/2012/08/android-working-with-google-places-and-maps-tutorial/ And I am able to run it, but the error I am receiving in the logcat is Places Status : REQUEST_DENIED Which makes me think I need to change part of the code with a key of my own.

I do indeed already have a Google Maps API key which I am using here in the application.

Thanks in advance for your time and help all!

-Sil

EDIT: See additional picture: Picture 3

PGMacDesign
  • 6,092
  • 8
  • 41
  • 78

2 Answers2

0

See the [Android key] button next to the [Browser key] button you highlighted.

Click on that [Android key] button.

;)

Stephan Branczyk
  • 9,363
  • 2
  • 33
  • 49
  • Stephan, Indeed! That would be the most logical, but I have already done that and am using an API key from it. The errors are persisting though. Is the API key I receive from there different than the one I will use for Places? – PGMacDesign Jun 19 '14 at 00:30
  • Your existing Google Maps key, for what version of Google Maps is it? Note that the tutorial you're using is from 2012, which predates the time the new Android Google Maps api came out. – Stephan Branczyk Jun 19 '14 at 02:15
  • Stephan, I edited the post above to show the Android key that I made 2 days ago. Is that the only key needed for Places? I was under the impression from the tutorials that Places has a different Key than maps. – PGMacDesign Jun 19 '14 at 05:22
0

Well, it turns out that my phrasing was just poorly worded :(

I rephrased what I was looking for here: How do I get a Google Places API key for my Android App

And the answer I received was:

Please Follow below steps
Visit the Google APIs Console at https://code.google.com/apis/console and log in with your Google account.
A default project called API Project is created for you when you first log in to the APIs Console. You can use the project, or create a new one by clicking the API Project button at the top of the window and selecting Create. Maps API for Business customers must use the API project created for them as part of their Places for Business purchase.
Click the Services link in the left-hand navigation panel.
Click the status switch (the on/off button) next to the Places API entry. The switch slides to ON.
Click API Access in the left-hand navigation panel.
Click Create new Server key. Enter one or more server IP addresses if you wish to restrict the servers that can send API requests.
Click Create. Your API key appears under the heading Key for server apps (with IP locking).

This solved the issue I was having entirely.

Thank you for taking the time to help Stephan, I appreciate it as you got me going in the right direction

Community
  • 1
  • 1
PGMacDesign
  • 6,092
  • 8
  • 41
  • 78