Was not disappointed by this video, came to find out how to draw directions on a map and you delivered on that front, thank you kindly for sharing this video. My only real criticism (I'm not going to use your source code) I think it would be nicer for the general public if, you massively simplified what is being built (A very simple and basic app with none of the fanciness, just show how to use the directions API to draw on map) allowing a person to focus on what you are trying to deliver as opposed to getting confused around some of the stuff in the middle
I am trying to access the directionsList String[] of polylines back in my main MapsActivity. I have tried using static fields, but directionsList becomes null when I access it via static fields. do you have any ideas of how i do this?
java.lang.NullPointerException: Attempt to invoke virtual method 'int org.json.JSONArray.length()' on a null object reference i have this error how can i solved this can you please help me
hello,Mam Can we set marker to go on some particular latlng co-ordinates on 'onMarkerClick'method and show us directions from our current location to that marker location,is that possible,please reply?
great video ... i just wanted ask that is there any video tutorial for "live video streaming" in android studio.. from last 1 week i m trying to find out something like this.. if is there any video tutorial then plz let me know . thank you
madam will you please add a new tutoriel about how to show the direction between the current location and one of the marker which notice the nearby places (hospitals , school or restaurent )!
Hi I'am very thankful to your tutorials in terms of GoogleMap in android.. it is very helpful in to my project.. i have problem in term of autocomplete in google map and searching a location.. can you make a tutorial for it thank you.. so much..
Can u make a video that use sensor like accelerometer to get data on whichever direction mobile is getting moved ....it shows map of that direction...Like current Google maps shows..
Hello mam! can you please make a video that include turn by turn navigation along with polyline. I try to use "travel_mode" but I am unable to implement turn by turn navigation.
Hello mam.. I have one doubt...When I run the code and search a place it is showing path perfectly but again If i searched for some other place..The path of previously searched place is also showing... Please tell me how to clear the previously searched path?!
Polyline just stores latitude longitude values. It can't give distance and duration values. You can check how the polyline is encoded so you'll get a better idea. If you need distance and duration then you'll need to fetch those values separately from the JSON reposnse.
Hi, the programme works for me but when i change the marker to a another location the older poly line still stays.... How do i code such that the older polyline is cleared
hi, i got this error while doing excacly the same and also the same code when i press TO FATAL EXCEPTION: main Process: comb.example.marke.healthcenterapp, PID: 31897 java.lang.NullPointerException: Attempt to invoke virtual method 'int org.json.JSONArray.length()' on a null object reference at comb.example.marke.healthcenterapp.DataParser.getPaths(DataParser.java:146) at comb.example.marke.healthcenterapp.DataParser.parseDirections(DataParser.java:140) at comb.example.marke.healthcenterapp.GetDirectionsData.onPostExecute(GetDirectionsData.java:52) at comb.example.marke.healthcenterapp.GetDirectionsData.onPostExecute(GetDirectionsData.java:22) at android.os.AsyncTask.finish(AsyncTask.java:667) at android.os.AsyncTask.-wrap1(AsyncTask.java) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:684) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:241) at android.app.ActivityThread.main(ActivityThread.java:6274) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Application terminated.
You need to add one more parameter to it. You need to set the mode=walking. So, use the append function one more time and include this ("&mode=walking")
hello mam, nice tutorial but mam we cannot use this tutorial to navigate from one location to another as this is not showing the exact roads while showing the directions. Please do something for that mam. Make a video by which we can even navigate like navigation in google maps. Thank you
It does show exact roads. But, you can't do turn by turn navigation just like google maps. But, the json response contains html_instructions field in the steps array for each path. So, it will tell you turn left from here and turn right from here. You can even fetch the start and end locations from them and change the html instructions accordingly. But, you can't implement navigation exactly like google maps.
I need some help guys I get this error java.lang.NullPointerException: Attempt to invoke virtual method 'int org.json.JSONArray.length()' on a null object reference
I know this is probably solved, but for anyone else wondering, you need to add implementation to use it. Implement 'com.google.maps.android:android-maps-utils:0.5'
What is the error? Check if you have imported the PolyUtil class or not. Otherwise make sire that the string that you are passing to PolyUtil.decode() method is a valid encoded polyline or not. stackoverflow.com/questions/33433415/android-googlemaps-api-indexoutofboundsexception-in-polyutil-decode
wonderful Code........ works and Github code helped me a lot , For "To" button error just add Try Catch block it will work only for 1 time as Direction API limit is 1 per day for free users. How can I increase this quota if anybody knows please reply me