When you have a list of longitude latitudes in your list, you can use the following to draw lines.
List<LatLng> points = decodePoly(_path); // list of latlng for (int i = 0; i < points.size() - 1; i++) { LatLng src = points.get(i); LatLng dest = points.get(i + 1); // mMap is the Map Object Polyline line = mMap.addPolyline( new PolylineOptions().add( new LatLng(src.latitude, src.longitude), new LatLng(dest.latitude,dest.longitude) ).width(2).color(Color.BLUE).geodesic(true) ); }
above worked for me in my application
source share