I m not sure this is working o nt…. when i go to this link maps.googleapis.com/maps/api/place/nearbysearch/json? ..it shows request denied… sir i wud lyk to know..why is it shwing request denied? jst for knowledge..

Hey, this is a great post. For some reason I am not getting any of the markers showing up when i press FIND. The listener for the Find button is working just fine but not sure why the markers aren’t showing up. I logged out sb.toString() and it shows that everything logs out just fine. So I know the details are received. Not sure why the markers aren’t showing up. I will continue to look into this in the mean time and send you another email if I get it to work. Thanks

This tutorial is just too Good.Thanks a lot.It saved my time.Can you also tell me how can I show the route to this nearest places selected with the distance specified,so that the users could choose the nearest place ? Hope you can help.

Yes,Sorry for Disturbing I added API key from “Key for Android apps (with certificates)” Instead of “Key for browser apps (with referers)” Now It works great .Thank you very very much george! For this great tutorial .

Your tutorial is up-to-date, cover the right scope (not too complicated, not too simple task) and it explains the 2 different keys needed for Google Maps Android API and Places API (my chief confusion last few days).

hi i see your demo app but i have one question …after getting all marker near by place .. i wann to put intent for description of that marker to new page so how i can add marker with specific id not marker.getId() i mean i wann to change default marker id to specific id how i can do this

Hiii .. first of all Thanks for providing such a nice explanation Doubt : What is the proper format to put multiple ‘place_type’ in tag, corresponding to a single ‘place_type_name’. Like I want : atm bank corresponding to AtmBank to be something like this : atm,bank corresponding to : Bank Outlets So, I want to know the proper format to write ‘atm,bank’. This comma thing ‘,’ is wrong. Thanks in advance !

Thank you for your good tutorial,But i splitted your MainActivity.java into two first class download the data and second class show the map and markers so i need to send the list value to the next intent what should i do now?

Hi, i am located in Egypt, and i have a question please, i executed your code following all steps in the tutorial, but when i press in find button there is not places appear nearby me, i do not know what is the problem, and another question for places API key; when i create new android key i see 2 keys created 1 for android app and another 1 for browser key (i made places API on in services) does this key used for places? and where i should put it in my Application ? in replacement of Google maps key or what ? Thanks appreciate your help.

Thanks very much, this solved the problemm, actually we are working together but i have another question please how can i show the places in a list ? what i want to do is show places in a list then if i pressed on any item it will draw a route from my current location to this place? Thanks in advance

have you resolved this problem? Actually i have the same problem of showing places in a list then if i pressed on any item it will draw a route from my current location to this place.Can you please tell me a way of doing it? Thank you

Hi, first thank you for this helpful tutorial, second, my maps is working fine so I assume that the Google Maps Android API is working perfectly, though I don’t think the place is working in my maps, I obtained it for the google api’s consol website by clicking on “Generate new browser key..” and I’ve put in in line 128 as you showed in the tutorial, still not working. Is it because that I should specify a name for a website when I click generate new browser key or what? and if yes what URL should I enter?

Thank you so much man, such an amazing tutorial, it’s working perfectly now. I have a question, how the map know the places I input in the strings file? Because I’m trying to give it a name of a shop for example “Walmart” it’s not showing in the map?

Hi George. First of all thank you for this tutorial. I have a problem please help me. I can see my location (it works) but i dont get any reaction when i touch find button. I have been try to fix this problem for a long time. Its my senior project. Please help me. Thank you.

“list” is an ArrayList of HashMap objects where each HashMap object represents a place with keys, place_name, vicinity, lat and lng. So “list” contains all the nearby places. This array list is created in the class PlaceJSONParser.

Hi george;I dont get the markers on the map.What the reason of this problem.everything is allright,I dont get error but only the markers is not visible.So important for me please help.thanks for everythng.

hey Ashwini, i already solved the problem. NullPointerException at onPostExecute indicates that your app didn’t retrieve any data from Google database via Google Places API. Hmm..i think you have to double check your Places API’s configuration. You should create a new Browser key instead of a new Android key from Google APIs Console. And I realized that when you are creating an either Android key or Browser key, you should just click on create button without keying any certificate fingerprints or package, so that the key generated can be used by any apps.

I am wondering if you could help me with a modification of this code. I have done some other of your tutorials, and now I would like to display the Places of interest along a selected route from one point to another. I don’t know how to make the query in this case. Thanks in advance!

While running in the Emulator, its displaying error msg as.. This app won’t run unless you update the google play services. And while clicking update button it shows as unfortunately this app has stopped. Pls help me solve tis problem

hello sir thanks for such a nice tutorial. it was helpful. the only problem i have is that when i run the application on my emulator, it says i have to update google play services before the app will run. i check my SDK manager and my google play is up-to-date. please help me with this problem. thanking you

and also after is says i should update google play services before i could run the app, i clicked the update button on the interface of the app but got this message: “unfortunately locationnearby has stopped” please help me sir

hello sir. thanks for this tutorial. it has been helpful. however, when i try click on find button on the emulator, nothing happens. i checked the logcat and found the following message: googgle maps android API v2 only supports devices with OpenGL ES 2.0

Hello George Very good tutoral. please can you tell me how to add google map search to this project. i have the code but i cant have two oncreate method on the same activity. please can you show me how to do this. either through email or posted here. thank you very much

Hello,this is a great tutorial.I have few questions 1.How to a polyline from current location to nearest marker ? 2.How to draw a polyline from my current location to touched marker using on marker click listener ? Thamks in advance..

Sir, i already follow your tutorial, already activate “Places API” & “Google Maps Android API v2″, and also using Key for browser apps (with referers). i’m running this sample on Genymotion. first it’s show the map with my current location with default marker. the problem is, when i select a place via spinner, e.g Hospital, the app is suddenly crash. on the logcat, it sayed java.lang.NullPointerException at com.example.app.Places_On_Resta_Map$ParserTask.onPostExecute. can you help me sir?? it’s for my collage project. thanks

Hello, Sir, this code is working fine and showing map on my device properly, so Google Map API working fine, but when i click on FIND button my application crash and showing the error AndroidRuntime(8116): at com.android4me.hotelsnearby.MainActivity$ParserTask.onPostExecute(MainActivity.java:251). I double check my Both API(Maps API and Place API) and placed at there proper place(in Menifest and MainActivtiy), I have tried also new created keys. I had also check the URL which is shown by LOGCAT by printing StringBuffer object variable, and pasted it in browser but it shows me following: { “html_attributions” : [], “results” : [], “status” : “ZERO_RESULTS” } Please help…

I downloaded your code and run with virtual device which run android 4.2 api17 with google api and no google api and it crashes where did I go wrong? could you tell me ? The Error Code : Unable to start activity ComponentInfo{in.wptrafficanalyzer.locationnearby/in.wptrafficanalyzer.locationnearby.MainActivity}: android.view.InflateException: Binary XML file line #21: Error inflating class fragment

hi, sir thank you sir its work good .great sir i need help from u if i whante to drwa a path from curent location to any place(e.g hotel if user click any hotel)path will be show. how can i did it plzzzzzzz sir

Firs of all thanx for this nice tutorial George I am confused when we enable place in Google api console what web site we have to write there and at the time of creating browser key it also requierd website name which web site i have to put there

I have but one problem, how do i get browser key api as you said in step 9. My project is perfectly running now but it doesnt show any places because i had to use android api key (which is stupid of course ) .

When I import this code into Android Studio 1.0.1, I get an unrecoverable error: * Project LocationNearby:C:\LocationNearby\project.properties: Library reference ..\google-play-services_lib could not be found Path is C:\LocationNearby\..\google-play-services_lib which resolves to C:\google-play-services_lib I tried to find this file in the SDK Manager, Extras, but I couldn’t.

Hello Sir, Can u please tell me how to get the nearest police station phone number using google api, currently I m using place api it was returning the details about nearest police station, but phone number is still missing. Help me to sort this problem.

Sir, I just copy your whole to see how its working I replace my own Keys with yours in manifest and in MainActivity class. but Nothing is happening its giving Exception of “Unable to start activity component, android.view.inflateException: Binary XML file line #21: Error inflating class fragment” Please Reply as soon as possible

Hey buddy I follow all ur steps even it shows everything gona fine in logcat but i am not able to view map its shows white screen with find bar and button having find I download projects from this site only and put my access keys at their perspective position but i am not able to see map pls can u tell me reason?

Hello Sir, Thanks for your help, eveything is good for your coding, very helpful to do my fyp, very appreciate it. =) But there is a problem for me, when my device disconnect any of the internet or gps, after i click on the Find button, it will appear an error that say “Unfortunately, your apps are stopped”, then after clicking OK will go exit. May I know is that any way to do like a pop out window will appear and tell to “Please connect to an internet and GPS” instead of this error. Thanks sir.

Hi, I am using this code map is showing current location but find is not working and it shows following error: maps.googleapis.com/maps/api/place/nearbysearch/json?location=22.69614649,75.86546569&radius=5000&types=doctor&sensor=false&key=AIzaSyCHR9JrsLUy8bcP27BCfdw0P_NZIYo6GQ0 {“error_message”:”This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https:\/\/code.google.com\/apis\/console”,”html_attributions”:[],”results”:[],”status”:”REQUEST_DENIED”}

i open it in emulator but says :google play service is not supported in you device .

there is ok button below this text.when push it close the app and show this erro : 07-25 21:09:33.100: E/AndroidRuntime(2017): FATAL EXCEPTION: main : java.lang.NullPointerException at android.app.Instrumentation.execStartActivity(Instrumentation.java:1410) at android.app.Activity.startActivityForResult(Activity.java:3370)

I have a question, this example works perfect. When I insert the map at a Fragment (not v4) I have had many problems in my application I have three tabs and one of them will be the Map. Could you help me guiding me as I embed one FragmentActivity into a Tab using the commit () the Fragment or perhaps an example Maps on Fragments?

The data that is received from google places API which you have parsed from Json into a list object , can you save that data in your personal database to fetch the details of the place later from your own database ? Thanks

Sir, Recently google has changed it’s procedure for creating the API key. And in the documentation there is nothing about how to create API key. So please can you tell us how to create API key, because I tried with API key, server key and browser key. But no one key is working. Thanks in advance.

For people not getting any markers when pressing the FIND button,that is because the latitude’s & longitude’s value is still 0.0 & 0.0 respectively. What you need to do is to improvise the code so that it stores your current location explicitly. Then pressing the Find button will display the markers.

Hello Sir, I have a got a problem.Everything is working fine but except one thing – Place Api. It’s not getting enabled and I am not able to solve this problem. Hope you will help me. and I really appreciate you for this code. and Thanks in advance !

Thank you so much for your tutorial. I am able to get my current location, but I am not able to see any markers and even after selecting ATM or airport from menu and clicking on “Find” button, no markers shows up.

Sir i need some help regarding google map. I have a current location now i want to list all nearest location which is between my current location and around 50/100 kilometers using S.E/N.W. I am stuck that point from last 2 weeks. Any help would be really appreciate.

Hello, not getting any response while I am changing the data items (like ATM, Airport and all) from spinner. Application just showing the Map. So can you please help me, I am running this same code on Android Studio. Thanks in Advance.

sir, i m currently working on a google Map based application using android studio. In this application i want share some information within a radius, that radius are set by me.. sir i have no any idea how to do it.. plz help or guide me..