This is my current map and what I want. We see in blue the current lines drawn, and in red those expected. I want the user's trips to follow the road and not get out. I have no clue on how to proceed. And feel free to give some advice on the user's locations data storage in database to make a " history road taken". Thanks!
mMap = googleMap;
ArrayList<LatLng> coordList = new ArrayList<LatLng>();
coordList.add(new LatLng(XXXXXXXX, XXXXXXXX));
coordList.add(new LatLng(XXXXXXXX, XXXXXXXX));
coordList.add(new LatLng(XXXXXXXX, XXXXXXXX));
coordList.add(new LatLng(XXXXXXXX, XXXXXXXX));
coordList.add(new LatLng(XXXXXXXX, XXXXXXXX));
coordList.add(new LatLng(XXXXXXXX, XXXXXXXX));
coordList.add(new LatLng(XXXXXXXX, XXXXXXXX));
Polyline line = mMap.addPolyline(new PolylineOptions()
.addAll(coordList)
.width(10)
.color(Color.BLUE));