hi i have created app with integration of google map where i need to draw the path depends upon the driving movement. so here i can able to get the array of points which having current lat and lang at every 2 seconds now i want to draw the path by using of those lat and lang array of points and i need to put the marker at the source and destination point not in the intermediate points.
How can i do this, i have searched lot of time but still doesn't get solution what i expect so please tell me if u got any idea or solution to do.
UPATED MY CODE
i got the solution by using of this code
private void drawPath() {
PolylineOptions polylineOptions = new PolylineOptions();
int i = 0;
if (langtitudearray != null && latitudearray != null) {
for (i = 0; i < latitudearray.size(); i = i + 1) {
polylineOptions.add(new LatLng(latitudearray.get(i),
langtitudearray.get(i)));
}
addMarkers(
new LatLng(latitudearray.get(0), langtitudearray.get(0)),
new LatLng(latitudearray.get(latitudearray.size() - 1), langtitudearray.get(latitudearray.size() - 1)));
}
polylineOptions.color(Color.BLUE);
polylineOptions.width(6);
polylineOptions.geodesic(false);
map.addPolyline(polylineOptions);
}
just i could use the lat and lang array of points and add the markers as well as. Now the problem is. if i got more points of lat and lang in array, there will take a time to load on the map which makes app is hanging if even i could get those array of points from the service by sending broadcast at 30 sec once.
Note : i am getting those array of points from the API response which is running in background service and making lat and lang array then sending by broadcast to the activity.
How to resolve this issues and what is the better approach to do? Thanks in Advance.