In this article we will develop an Android Application which displays a set of nearby places of current location in Google Map according to the type entered in the Spinner widget.
This application makes use of Google services like Google Map Android API V2 and Google Places API.
This application is developed in Eclipse (4.2.1) with ADT plugin (21.0.0) and Android SDK (21.0.0) and tested in a real device with Android 2.3.6 ( GingerBread ).
1. Create a new Android application project namely “LocationNearby”
2. Configure the project
3. Design application launcher icon
4. Create a blank activity
5. Enter MainActivity details
6. Download and configure Google Play Services Library in Eclipse
Please follow the given below link to setup Google Play Service library in Eclipse.
http://developer.android.com/google/play-services/setup.html
7. Add Google Play Services Library to this project
8. Get the API key for Google Maps Android API V2
We need to get an API key from Google to use Google Maps in Android application.
Please follow the given below link to get the API key for Google Maps Android API v2.
https://developers.google.com/maps/documentation/android/start
9. Get the API key for Google Places API
We can create API key for Google Place API by clicking “Create new Browser key” available at the “API Access” pane of the Google console URL : http://code.google.com/apis/console.
Also ensure that, “Places API” is enabled in the “Services” pane of the Google console.
10. Add Android Support library to this project
By default, Android support library (android-support-v4.jar ) is added to this project by Eclipse IDE to the directory libs. If it is not added, we can do it manually by doing the following steps :
- Open Project Explorer by Clicking “Window -> Show View -> Project Explorer”
- Right click this project
- Then from popup menu, Click “Android Tools -> Add Support Library “
11. Update the file res/values/strings.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">LocationNearby</string> <string name="hello_world">Hello world!</string> <string name="menu_settings">Settings</string> <string name="str_btn_find">Find</string> <string-array name="place_type"> <item>airport</item> <item>atm</item> <item>bank</item> <item>bus_station</item> <item>church</item> <item>doctor</item> <item>hospital</item> <item>mosque</item> <item>movie_theater</item> <item>hindu_temple</item> <item>restaurant</item> </string-array> <string-array name="place_type_name"> <item>Airport</item> <item>ATM</item> <item>Bank</item> <item>Bus Station</item> <item>Church</item> <item>Doctor</item> <item>Hospital</item> <item>Mosque</item> <item>Movie Theater</item> <item>Hindu Temple</item> <item>Restaurant</item> </string-array> </resources>
Note : Defining string arrays to populate Spinner Widget with Place types.
12. Update the layout file res/layout/activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > <Spinner android:id="@+id/spr_place_type" android:layout_width="wrap_content" android:layout_height="60dp" android:layout_alignParentTop="true" /> <Button android:id="@+id/btn_find" android:layout_width="wrap_content" android:layout_height="60dp" android:layout_alignParentTop="true" android:layout_toRightOf="@id/spr_place_type" android:text="@string/str_btn_find" /> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/spr_place_type" class="com.google.android.gms.maps.SupportMapFragment" /> </RelativeLayout>
13. Create a new class namely “PlaceJSONParser” in the file src/in/wptrafficanalyzer/locationnearby/PlaceJSONParser.java
package in.wptrafficanalyzer.locationnearby; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; public class PlaceJSONParser { /** Receives a JSONObject and returns a list */ public List<HashMap<String,String>> parse(JSONObject jObject){ JSONArray jPlaces = null; try { /** Retrieves all the elements in the 'places' array */ jPlaces = jObject.getJSONArray("results"); } catch (JSONException e) { e.printStackTrace(); } /** Invoking getPlaces with the array of json object * where each json object represent a place */ return getPlaces(jPlaces); } private List<HashMap<String, String>> getPlaces(JSONArray jPlaces){ int placesCount = jPlaces.length(); List<HashMap<String, String>> placesList = new ArrayList<HashMap<String,String>>(); HashMap<String, String> place = null; /** Taking each place, parses and adds to list object */ for(int i=0; i<placesCount;i++){ try { /** Call getPlace with place JSON object to parse the place */ place = getPlace((JSONObject)jPlaces.get(i)); placesList.add(place); } catch (JSONException e) { e.printStackTrace(); } } return placesList; } /** Parsing the Place JSON object */ private HashMap<String, String> getPlace(JSONObject jPlace){ HashMap<String, String> place = new HashMap<String, String>(); String placeName = "-NA-"; String vicinity="-NA-"; String latitude=""; String longitude=""; try { // Extracting Place name, if available if(!jPlace.isNull("name")){ placeName = jPlace.getString("name"); } // Extracting Place Vicinity, if available if(!jPlace.isNull("vicinity")){ vicinity = jPlace.getString("vicinity"); } latitude = jPlace.getJSONObject("geometry").getJSONObject("location").getString("lat"); longitude = jPlace.getJSONObject("geometry").getJSONObject("location").getString("lng"); place.put("place_name", placeName); place.put("vicinity", vicinity); place.put("lat", latitude); place.put("lng", longitude); } catch (JSONException e) { e.printStackTrace(); } return place; } }
Note : This class parses the Google Places in JSON format and returns a List object.
14. Update the class “MainActivity” in the file src/in/wptrafficanalyzer/locationnearby/MainActivity.java
package in.wptrafficanalyzer.locationnearby; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.HashMap; import java.util.List; import org.json.JSONObject; import android.app.Dialog; import android.location.Criteria; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.util.Log; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.Spinner; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; public class MainActivity extends FragmentActivity implements LocationListener{ GoogleMap mGoogleMap; Spinner mSprPlaceType; String[] mPlaceType=null; String[] mPlaceTypeName=null; double mLatitude=0; double mLongitude=0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Array of place types mPlaceType = getResources().getStringArray(R.array.place_type); // Array of place type names mPlaceTypeName = getResources().getStringArray(R.array.place_type_name); // Creating an array adapter with an array of Place types // to populate the spinner ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_dropdown_item, mPlaceTypeName); // Getting reference to the Spinner mSprPlaceType = (Spinner) findViewById(R.id.spr_place_type); // Setting adapter on Spinner to set place types mSprPlaceType.setAdapter(adapter); Button btnFind; // Getting reference to Find Button btnFind = ( Button ) findViewById(R.id.btn_find); // Getting Google Play availability status int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext()); if(status!=ConnectionResult.SUCCESS){ // Google Play Services are not available int requestCode = 10; Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this, requestCode); dialog.show(); }else { // Google Play Services are available // Getting reference to the SupportMapFragment SupportMapFragment fragment = ( SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); // Getting Google Map mGoogleMap = fragment.getMap(); // Enabling MyLocation in Google Map mGoogleMap.setMyLocationEnabled(true); // Getting LocationManager object from System Service LOCATION_SERVICE LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); // Creating a criteria object to retrieve provider Criteria criteria = new Criteria(); // Getting the name of the best provider String provider = locationManager.getBestProvider(criteria, true); // Getting Current Location From GPS Location location = locationManager.getLastKnownLocation(provider); if(location!=null){ onLocationChanged(location); } locationManager.requestLocationUpdates(provider, 20000, 0, this); // Setting click event lister for the find button btnFind.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { int selectedPosition = mSprPlaceType.getSelectedItemPosition(); String type = mPlaceType[selectedPosition]; StringBuilder sb = new StringBuilder("https://maps.googleapis.com/maps/api/place/nearbysearch/json?"); sb.append("location="+mLatitude+","+mLongitude); sb.append("&radius=5000"); sb.append("&types="+type); sb.append("&sensor=true"); sb.append("&key=YOUR_API_KEY"); // Creating a new non-ui thread task to download json data PlacesTask placesTask = new PlacesTask(); // Invokes the "doInBackground()" method of the class PlaceTask placesTask.execute(sb.toString()); } }); } } /** A method to download json data from url */ private String downloadUrl(String strUrl) throws IOException{ String data = ""; InputStream iStream = null; HttpURLConnection urlConnection = null; try{ URL url = new URL(strUrl); // Creating an http connection to communicate with url urlConnection = (HttpURLConnection) url.openConnection(); // Connecting to url urlConnection.connect(); // Reading data from url iStream = urlConnection.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(iStream)); StringBuffer sb = new StringBuffer(); String line = ""; while( ( line = br.readLine()) != null){ sb.append(line); } data = sb.toString(); br.close(); }catch(Exception e){ Log.d("Exception while downloading url", e.toString()); }finally{ iStream.close(); urlConnection.disconnect(); } return data; } /** A class, to download Google Places */ private class PlacesTask extends AsyncTask<String, Integer, String>{ String data = null; // Invoked by execute() method of this object @Override protected String doInBackground(String... url) { try{ data = downloadUrl(url[0]); }catch(Exception e){ Log.d("Background Task",e.toString()); } return data; } // Executed after the complete execution of doInBackground() method @Override protected void onPostExecute(String result){ ParserTask parserTask = new ParserTask(); // Start parsing the Google places in JSON format // Invokes the "doInBackground()" method of the class ParseTask parserTask.execute(result); } } /** A class to parse the Google Places in JSON format */ private class ParserTask extends AsyncTask<String, Integer, List<HashMap<String,String>>>{ JSONObject jObject; // Invoked by execute() method of this object @Override protected List<HashMap<String,String>> doInBackground(String... jsonData) { List<HashMap<String, String>> places = null; PlaceJSONParser placeJsonParser = new PlaceJSONParser(); try{ jObject = new JSONObject(jsonData[0]); /** Getting the parsed data as a List construct */ places = placeJsonParser.parse(jObject); }catch(Exception e){ Log.d("Exception",e.toString()); } return places; } // Executed after the complete execution of doInBackground() method @Override protected void onPostExecute(List<HashMap<String,String>> list){ // Clears all the existing markers mGoogleMap.clear(); for(int i=0;i<list.size();i++){ // Creating a marker MarkerOptions markerOptions = new MarkerOptions(); // Getting a place from the places list HashMap<String, String> hmPlace = list.get(i); // Getting latitude of the place double lat = Double.parseDouble(hmPlace.get("lat")); // Getting longitude of the place double lng = Double.parseDouble(hmPlace.get("lng")); // Getting name String name = hmPlace.get("place_name"); // Getting vicinity String vicinity = hmPlace.get("vicinity"); LatLng latLng = new LatLng(lat, lng); // Setting the position for the marker markerOptions.position(latLng); // Setting the title for the marker. //This will be displayed on taping the marker markerOptions.title(name + " : " + vicinity); // Placing a marker on the touched position mGoogleMap.addMarker(markerOptions); } } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_main, menu); return true; } @Override public void onLocationChanged(Location location) { mLatitude = location.getLatitude(); mLongitude = location.getLongitude(); LatLng latLng = new LatLng(mLatitude, mLongitude); mGoogleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng)); mGoogleMap.animateCamera(CameraUpdateFactory.zoomTo(12)); } @Override public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } @Override public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } @Override public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } }
Note : At line 128, replace “YOUR_API_KEY” with the api key obtained in Step 9.
15. Update the file AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="in.wptrafficanalyzer.locationnearby" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" /> <permission android:name="in.wptrafficanalyzer.locationnearby.permission.MAPS_RECEIVE" android:protectionLevel="signature"/> <uses-permission android:name="in.wptrafficanalyzer.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-feature android:glEsVersion="0x00020000" android:required="true"/> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="in.wptrafficanalyzer.locationnearby.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="YOUR_API_KEY"/> </application> </manifest>
Note : At line 43, replace “YOUR_API_KEY” with the api key obtained in step 8.
16. Screenshot of the application
17. Download


I am George Mathew, working as software architect and Android app developer at wptrafficanalyzer.in
You can hire me on hourly basis or on project basis for Android applications development.
For hiring me, please mail your requirements to info@wptrafficanalyzer.in.
My other blogs
store4js.blogspot.com
THANK YOU SOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO MUCH!!! I WAS TRUING TO DO THAT IN WEEKS!!!! IT’S WORKING PERFECTLY!!!
Hai pls send me the code ….iam downloading that code but it hace lot of errors..pls sir send d code
me too please
can you please send me your code? the code given here is not correctly working for me ….. my id : bommireddipalliaditya@gmail.com
i am trying to do that in android 6.0 but its not working .pls help me.
can you tell me what to do if i want to show a fixed area in my app not all the world when i entered into that fragment..
Mrng Sir….
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..
Thank u So much Sir…
you have to switch on the google place service on ..so it will remove the error
firstly switch on google place service and map service also ..then it will remove
this link is not working: maps.googleapis.com/maps/api/place/nearbysearch/json?
..it shows request denied…
Please if You got any json link or project to get Nearest Hospital please send it
You must use your own API key (for browser apps and for android apps). It works great!
Sir I insert my own key in to that code but when i run this the simulator shows message that “unfortunately application has stopped” .
Would you help me why this app not run
i am face same problem …sir please reply this
Now i overcome this problem
Hi,did you fixed it,please write.
work with android android studio.eclipse not working in this case
Did u change the package name in manifest
Hey Thanks Sir…
Would u please tell me How much will i be charged for google places api key…..?????
Thank U So much Sir…!!
Nothing it’s free. You are welcome!
But it is having some usage limits. Please see the link given below :
developers.google.com/places/policies#usage_limits
hello,
very good tutorials!!
can you see a reason why this not working? (the key is from my api console)
maps.googleapis.com/maps/api/place/nearbysearch/json?location=32.1145134,34.8269532&radius=5000&types=atm&sensor=true&key=MY_KEY
thanks in advance
muli
Please ensure that, you created a “Browser key” from Google API console and you enabled “Places API” in “Services” menu.
sir can you tell me which url i need to give while generating browser key
because when i run this application ,nothing will happened when click on button. so plz. tell me what is the issue
sir can you tell me which url i need to give while generating browser key
because when i run this application ,nothing will happened when click on button. so plz. tell me what is the issue
it does not show any marker. plz plz. help me .
maps.googleapis.com/maps/api/place/search/json?location=32.1145134,34.8269532&radius=5000&types=atm&sensor=true&key=MY_KEY
use this nearbysearch instead of it searach only
THANK YOU SOOO MUCH FOR THIS !!!!!!
I’ve been Googling a SIMPLE answer to solve this ALL day, WHY can’t people write up something as simple as this.
You’ve definitely helped me a lot, thanks!
i just need to show nearby restaurants on map…using google places api. how can i do that?
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
Luis
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.
Hi, JJ
Did you achieve to draw the route to these places? I’m strugglin a bit with that.
Thanks in advance
Thank you.
For some reason I am not getting any of the markers showing up when i press FIND.
It works.
What was the problem? I’m having the same problem. Markers are t showing up at all
Please mr Luis.. help how you solve to show marker???
how did u solve this problem sir. when i press find nothing happens.
I am also not getting any of the markers. I am using the correct API key….any ideas???
Thanks
Hi,George .. This is great Stuff ..Thank you very much .
I ran it but its not showing the markers.I got my current location,And i got the following Errors:
1.
registerListener :: handle = 0 name= BMA222 delay= 20000 Listener= maps.h.a@405e8f28
2.
unregisterListener:: all sensors, listener = maps.h.a@405e8f28
Please could you help me ? Thanks a lot in advance
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 .
Perfectly it Worked!!! Thank you so much
how can i activate api places please
1. Login into https://code.google.com/apis/console/
2. Click Services link
3. Find “Places API” and click “On/Off” status button to activate place api
Hi, I followed the whole tutorial which is really helpful. But when i deploy it on the emulator, it says “you need google play services”.
Can you suggest what can be the reason for not detecting the google API.
I have done the following:
1. placed the google-play-services_lib in my workspace.
2. Included it in my project library.
Please help. Thanks
i just realized that the google play services dont work on emulator..tried it on my android phone! and its working.!! thank u so much! your code rocks….
Millions of thanks to you George!
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).
All the best!
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
can you show me the example how you put the marker in? i am a student and is quite new to these things many thanks.
this tutorial is good man real good but 1 problem is i till now still cant figure how to add marker into it can any 1 please show me an example on how to do it please.
Hi Dominick,
I am not understanding your real problem.
Hello!!
I use your code and search in Chinese
But nothing returned
How can I improve with your code?
Please help…
Thank you.
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 !
Hai Pal,
Separate types with a pipe symbol (type1|type2|etc)
Perfectly it Worked!!! Thank you so much
setContentView(R.layout.activity_main);
activity_main cannot be resolved. Please help me.
Please ensure that, the class MainActivity is not importing “android.R”
Thank you .!
It shows maps and current location. But on clicking the find button it shows nothing. I tried changing the radius also.
Help
Thanks alot Sir you have solved my problem,,,
But my problem is not solved. What changes have you done to the code>?
Hi Vishak,
Please ensure the following :
=> You have enabled Places API service in Google APIs console
=> Created “Browser Key” as key for Places API from Google APIs console
Sir,I have also same problem.on clicking the find button it shows nothing..after shows “This apps wont run unless you update google play service”.nothing happen.i m putting correct API keys and enable Places API but nothing work sir,Kinldy give solution
Thank alot Sir now i don’t need any search i will only share my problems with you,,,
Sir when I click find button it doesn’t do any thing,plz help
Sir when I click find button it doesn’t do any thing,plz help,
Sir it also give me error on following line in layout.xml file.
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
Hi,
Are you getting any hint on error message in Logcat?
In the mean time, please ensure the following :
=> You have enabled Places API service in Google APIs console
=> Created “Browser Key” as key for Places API from Google APIs console
VERY Good tutorial but i don’t know why there is no markers :/ is there some solutions ???
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?
Hello dear,
Thanks for such a nice tutorial.
I need to ask one thing why places are not appearing in my map, it is only showing my location, even FIND is not doing anything.
I have used generated :
– Key for browser apps (with referers)
– Key for Android apps (with certificates)
NEED HELP. As soon as possible.
Thanks.
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.
Browser API Key : This is the key obtained in step 9 and use it in the line 128 of the class MainActivity.
Android API Key : This is the key obtained in step 8 and use it in the line 43 of the file AndroidManifest.xml
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 , how can return nearby places for one place such as bus station only please help me and thnx in advance
Sir!
very nice tutorial..
my project is showing current location on map but when i click any place type in spinner e.g banks it does not show any results, plz tell me how can I solve the issue?????
Thanks in advance
Hi,
Thanks for such a nice tutorial
when I click find button it doesn’t do any thing ( Pleaaase Help )
I check two key several times ….
Hi Tinou,
Please ensure that, “Places API” is enabled in the “Services” pane of the Google console.
Hi,
yes it is enabled,
please it’s urgent
Hi,
Print the value of the StringBuffer variable sb of MainActivity class in Logcat to get the url and enter it in a web browser to see any places return?
Hi george,
it’s good, it works I create a new email address and I generate a new key …
Now I want to display the route when I select a location.
please help me this is really urgent it is for my final project study.
Unable to resolve superclass of L
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?
Hi Moe,
On generating browser key, we can keep the url referer field as blank.
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.
Hi George,
I want to display the route when I select a location.
please help me this is really urgent it is for my final project study.
Hi Tinou,
Please see the article titled “Driving route from my location to destination in Google Maps Android API V2“
Thank u very much for this tutorila
Would you please tell how to show the details of those places nearby?
Hi Jack,
Please check our new article “Showing nearby places and place details using Google Places API and Google Maps Android API V2“
can u explain to me the part of on post execute when i return the hashmap in list and then get the values in hash map i can’t understand this exactly and how can i put latlng only in list?
“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.
Hello Ceren,
Just try to recreate the keys and use it in the application
Hi george .. how to display the nearest location by using its own database?
Hi man, I really appreciate your work.
Many thanks.
i just need to show nearby mosque on map…using google places api. how can i do that?
Am getting the routes and the places using the above article but in background my map is not visible it just shows me plain grey color background with the places and it routes…
Why am not getting map in background
I need to ask one thing why places are not appearing in my map, it is only showing my location, FIND is generating this error.
07-09 13:26:21.989: D/Exception while downloading url(6520): java.net.UnknownHostException: maps.googleapis.com
07-09 13:26:21.989: D/Background Task(6520): java.lang.NullPointerException
07-09 13:26:22.029: D/Exception(6520): java.lang.NullPointerException
Figured out my problem Places API was not enabled.
HELP! Application force closed! Error is at ParserTask.onPostExecute().
FATAL EXCEPTION: main
java.lang.NullPointerException
com.android.nearbyhawker.MainActivity$ParserTask.onPostExecute(MainActivity.java:281)
com.android.nearbyhawker.MainActivity$ParserTask.onPostExecute(MainActivity.java:1)
android.os.AsyncTask.finish(AsyncTask.java:631)
android.os.AsyncTask.access$600(AsyncTask.java:177)
android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:137)
android.app.ActivityThread.main(ActivityThread.java:4745)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:511)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
dalvik.system.NativeStart.main(Native Method)
Any idea what happened?
Thank you!
hi…
I’m also facing the same issue as above, that is
08-08 15:46:38.882: E/AndroidRuntime(27602): FATAL EXCEPTION: main
08-08 15:46:38.882: E/AndroidRuntime(27602): java.lang.NullPointerException
08-08 15:46:38.882: E/AndroidRuntime(27602): at my.places.nearby.PlacesNear$ParserTask.onPostExecute(PlacesNear.java:242)
08-08 15:46:38.882: E/AndroidRuntime(27602): at android.os.AsyncTask.finish(AsyncTask.java:631)
08-08 15:46:38.882: E/AndroidRuntime(27602): at android.os.AsyncTask.access$600(AsyncTask.java:177)
08-08 15:46:38.882: E/AndroidRuntime(27602): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
08-08 15:46:38.882: E/AndroidRuntime(27602): at android.os.Handler.dispatchMessage(Handler.java:99)
08-08 15:46:38.882: E/AndroidRuntime(27602): at android.os.Looper.loop(Looper.java:153)
08-08 15:46:38.882: E/AndroidRuntime(27602): at android.app.ActivityThread.main(ActivityThread.java:5086)
08-08 15:46:38.882: E/AndroidRuntime(27602): at java.lang.reflect.Method.invokeNative(Native Method)
08-08 15:46:38.882: E/AndroidRuntime(27602): at java.lang.reflect.Method.invoke(Method.java:511)
08-08 15:46:38.882: E/AndroidRuntime(27602): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
08-08 15:46:38.882: E/AndroidRuntime(27602): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
08-08 15:46:38.882: E/AndroidRuntime(27602): at dalvik.system.NativeStart.main(Native Method)
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 getting this king of errors..can you please help me??????
09-27 19:11:34.691: E/AndroidRuntime(23165): FATAL EXCEPTION: main
09-27 19:11:34.691: E/AndroidRuntime(23165): java.lang.NullPointerException
09-27 19:11:34.691: E/AndroidRuntime(23165): at com.example.travelapp.MainActivity$ParserTask.onPostExecute(MainActivity.java:270)
09-27 19:11:34.691: E/AndroidRuntime(23165): at com.example.travelapp.MainActivity$ParserTask.onPostExecute(MainActivity.java:1)
09-27 19:11:34.691: E/AndroidRuntime(23165): at android.os.AsyncTask.finish(AsyncTask.java:602)
09-27 19:11:34.691: E/AndroidRuntime(23165): at android.os.AsyncTask.access$600(AsyncTask.java:156)
09-27 19:11:34.691: E/AndroidRuntime(23165): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:615)
09-27 19:11:34.691: E/AndroidRuntime(23165): at android.os.Handler.dispatchMessage(Handler.java:99)
09-27 19:11:34.691: E/AndroidRuntime(23165): at android.os.Looper.loop(Looper.java:137)
09-27 19:11:34.691: E/AndroidRuntime(23165): at android.app.ActivityThread.main(ActivityThread.java:4517)
09-27 19:11:34.691: E/AndroidRuntime(23165): at java.lang.reflect.Method.invokeNative(Native Method)
09-27 19:11:34.691: E/AndroidRuntime(23165): at java.lang.reflect.Method.invoke(Method.java:511)
09-27 19:11:34.691: E/AndroidRuntime(23165): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
09-27 19:11:34.691: E/AndroidRuntime(23165): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
09-27 19:11:34.691: E/AndroidRuntime(23165): at dalvik.system.NativeStart.main(Native Method)
Thank you so much for this tutorial. It’s been incredibly helpfull to me!
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!
Xavi
Hi Xavi,
I think the given below article will do for you.
“http://wptrafficanalyzer.in/blog/route-between-two-locations-with-waypoints-in-google-map-android-api-v2/“
Hi george i download your code run in my device it running fine but when i choose the place like atm,bank nothing will be displayed can you help me to solve this.
Hi Aravin,
Please print the downloaded data ( before parsing ) in logcat to check whether it contains any place or not for atm, bank etc.
It shows like the following.
“debug_info”:[]
“html_attributions”:[]
“results”:[]
“status”:”request denied”
Thank you george it worked fine . Really nice tut and simple to understand.
thanks sir,I am new programer in android field and your examples really help a lot.
Hi sir,
Thank you so much for this tutorial.
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
hi vignesh. i also have this same problem. did u solve yours? please tell me how if u did. thanking you.
Sweet..the code that I’m looking for..easy to follow and replicate..much appreciated..
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
i fix the problem thank you sir
Hi Amir,
Can I know how do you fix the problem please. Thanks.
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
Hi george, i have a question,
How to manage exception when no internet connection. so when i click Find Button apps wont crash because of no connection.
Hello,this working very well.thanks for this tutorial.
How can i had my own marker for showing places instead of default markers?
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..
Hi sir,
when i try click on find button on the emulator, nothing happens.
I Enter correct API Keys and on Places API,but nothing happens..
Kindly help me.
hello sir,
i entered the api key but nothing is displaying on the screen, please help me
hello sir, when i run the code nothing is diplaying on the screen, no map and no location.please help me as soon as possible as i m developing some live application.
hello sir , please help me as nothing is displaying on the screen.
Hello sir…
sir my question is that can i get particular place latitude and longitude by typing that place name as a text through this api
I want to show the near tourist locations.how to add the place name of that..please reply me..
for ex:if am in mysore ,it should mark on palace,K.R.S,etc..
It indicates an error in the line:
setContentView(R.layout.activity_main);
R cannot be resolved to a variable
Just copy the code and put my own keys, do I need to consider anything else?
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
I was having the same problem. Solved it from here stackoverflow.com/questions/21985449/asynctask-null-pointer-exception-google-places
when i using this application every thing is ok but i did it get my nearby placees.what should i do sir please help me
Hi sir. Nearby places not displayed. GPS is on wifi is on and checked the log of sb. which was fine but List places was empty. how to make it work . what we missed. plz help
hey really thank u so much
hi sir i want this code in pc version not in android,nw im dng project on maps so i hav to display the items in map when i click on the particular item like atm,shopping mall etc….help me out
thank u
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…
Hello Sir,
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
Make sure you have following code in your menifest under application tag,
” ”
remove outer qoutes.
Same error in my code pls someone know about it
Hi sir,
I am getting some error in String.xml file with this line-
and in MainActivity.java file with this line-
import android.widget.span class=”k52m04u77pn7″ id=”k52m04u77pn7_24″>widget</span.ArrayAdapter;
Please give me some solution.
Thank You,
Dear Sir,
2 things need your help Sir.
I got this error when trying to run the code that I download. “Unfortunately, LocationNearby has stopped.”
I got the Google play services installed.
It should not be related to the keys right? any idea how I can fix it?
and which project build target do I suppose to choose? “Android 4.2.2 and above” or “Google API”
Thanks.
Hi, thank you .. working!
im getting Unfortunately, LocationNearby has stopped what should i do? im using genymotion_vbox86p_4.2.2_130923_154637 as my emulator
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
Sir please help me and when i click on marker it shows unfortunetly stop
A wonderful tutorial….Thanks indeed…it was sooooooooo helpful
Thank you so so much bro, That helps me for my midterm project.
Nice Tutorial. First time, I was using browser key and its not showing markers of selecting places. When I use server key instead of browser key then working fine
Sir,I am not getting result on find button click,and getting resource not found while debugging..
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
Sir, when I run the project after adding both api keys and following all the steps mentioned it shows unfortunately stopped,please help me on this
12-01 00:33:55.840: E/AndroidRuntime(1002): FATAL EXCEPTION: main
12-01 00:33:55.840: E/AndroidRuntime(1002): Process: in.wptrafficanalyzer.locationnearby, PID: 1002
12-01 00:33:55.840: E/AndroidRuntime(1002): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
12-01 00:33:55.840: E/AndroidRuntime(1002): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
12-01 00:33:55.840: E/AndroidRuntime(1002): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
12-01 00:33:55.840: E/AndroidRuntime(1002): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)
12-01 00:33:55.840: E/AndroidRuntime(1002): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
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, if i want a particular location to show as the default map when lauched how can i do that sir?
hello if i want to display the places in a list form. what would i do.. thank you
Sir, i have used the source code in my project. I am getting the eror due to unable to start Activity :android.content.res.ResourceNOTFOUND Exception: String array resourceId.
Can you Please tell why i am getting this error?
Hi Mr.Mathew, thnx for the tutorial.
My question is that the above code returns only 20 results maximum and rest are ported to other pages of response.
So how to read and display all the locations by reading all pages??
Thanx in advance again
awesome code, its working for me!!!! thank u for such a useful example, perfect result
Do we need to pay for getting the place api key
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.
Thanks
sir hi,firstly thanks this tutorial ı run this but later when ı select item frpm spinner I get sendUserActionEvent mView== null error. do you know why?
light me please
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
try this it has worked for me
1- go to xml layout ” activity_main ” and changer the android version to use when rendering..etc to 13 , because the fragment needs version higher than 12 or equal to 12
2- when you got to make api key for browser make sure to leave the refers box empty , dont refer anything .. (to show places)
plus dont forget to insert the apikey for browser in the manifest
Hi,
Please help me to solve this given below my queries:
1. Can I send rating parameters to Google server using Google places API’s?
2. I have to pay Google for Google places & Google map services?
hello..I am new in android and wend through your this tutorial
http://wptrafficanalyzer.in/blog/showing-nearby-places-using-google-places-api-and-google-map-android-api-v2/
I have 2 questions relating this.Can you please help me?
1) I have added Rail Stations is string.xml .But no stations are showing in map.
2)If I want ti input a location(Like Mumbai) and get its nearby locations,what to do?? please help me..Otherwise your code is running …
Thanks
what i have to give as URL while creating browser key. pls any one reply me
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 when i want to find the details of a place the app crushes
Thanks
plz. tell me how to solve the problem ” it does not show any marker”
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?
Sir how do i get only the business places or malls,shops and so on?
Great tutorial!!! Worked perfectly!
Thank you so much…it really helped me.
Searched for many tutorials but ultimately this worked….
list is returning null, i have tried with browser api as well
Hello,
I got this error.
The meta-data tag in your app’s AndroidManifest.xml does not have the right value. Expected 6587000 but found 0. You must have the following declaration within the element:
Hello Sir,
Thanks for your tutorial. Please help me to solve my issue.
When i click on find button nothing is happened. Request denied message is appearing in my logcat.I added browser key and android key but i didn’t get nearby locations.
Please help me sir
Thank You.
Hi sir,
Thanks for the tutorial. Please help me to solve my issue. I am getting current location but unable to get nearby locations. It gives me Request Denied error.
Hi,
Greetings ,
could you please help me because search option is not working .
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”}
can somone help me please
{
“error_message” : “This IP, site or mobile application is not authorized to use this API key.”,
“html_attributions” : [],
“results” : [],
“status” : “REQUEST_DENIED”
}
Thank you so much for your tutorial!!
But after clicking find button i am not getting any marker on map. I did get browser and android key. my location on map is working fine.. Plz help me
hello.
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)
Sir,since the add event has been removed from the google place API since 2015, so how i going to do so?For example, an add extra info(event) about the discount/sale of the store/shop/cafe/restaurants.
hello.
i want change ATM to gas station.how i can do that??
thanks you…!
hello.
brwoser key is android api key???
how can i obtain a browser key??
Hello Sir George,
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?
Thank you very much Mr.
Fabio.
how i can i search for a specific place not a list of google supported places??
This IP, site or mobile application is not authorized to use this API key. Request received from IP address ***.***.**.***, with empty referer
can any 1 help me????
There is an error R cannot be resolved to a variable . Can you tell me how to solve this problem .Thanks
How to fetch rating
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
thank you for the tutorial.app runs perfectly but i am unable to find any places.it always shows map.what should i do. please help me on that issue.
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.
Hi,
I have downloaded the app and tried it. I installs well but when select a place it does not do anything. At first i thought it was the onclick listner intent.
Let me know. I have tried using browserkeys as well…
i tried the above code but when i select the options from the spinner section markers(places like bank or hospital…) are not updating..
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.
I am using correct Android key and Browser key. Please help.
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.
Sir, I had downloaded ur code and fixed all the errors..but when I am running on eclipse it is unfortunatly stopped… Please give me suggestion to run it successfully… I need it very urgnt
Can someone please tell me what I must LOG to show the results ?
I need to know if I’m receiving the data.
Thanks
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..
i followed all instructions as you described abovve i am not getting any error or exception,but when i click on the find button nothing is happening,plese solve this problem..
Everything is working fine but map isn’t showing when activity is launched.
Need Solution ASAP.
google map locaton in android studio plz sir …………………
Great tutorial..solved my problem..Thank you
Hi Good Evening,
I need without gps finding acurate location for example i am ground floor to top floor how can write polyline in android
Sir, I’m facing an error..
the error is in this line.
mGoogleMap = fragment.getMap() ;
how can i over come it ??
pls help me