Starting February 15, 2017, you can change the course line of the polyline. From the release note (my sheets)
This release introduces a custom style for polylines and contours of polygons and circles. Change the stroke pattern from the solid line (default) to choose dashes, dots, and spaces. In polylines and polygons you can specify the type of bevel or round joint to replace the fixed fixed seams installed by default, you can also change the cap at each end of the polyline from the butt (by default) to a square or round cover, or specify a custom raster map to be used as a cover. Modeling of stroke patterns, types of joints and caps of the beginning and the end is available in the full API, but not in the relief mode.
Please note that you will need to use Google Play Services 10.2 or higher. So in your build.gradle you will need to add:
dependencies { compile 'com.google.android.gms:play-services-maps:10.2.0' }
You can specify the stroke pattern of your polyline, but you cannot change the color, so you will need to draw a solid polyline and a dotted polypin on top of it to achieve the desired pattern (note that you will draw two polylines instead of one, and this can affect performance ):
List<LatLng> latLngs = new ArrayList<>();
The result is as follows:

You can find more information about the new style polyline feature here .
source share