Code example for PolylineOptions

0
public class MainActivity extends FragmentActivity { 
 
	GoogleMap mGoogleMap;
	LatLng loc = new LatLng(36.144425,128.393269);
	 
	PolylineOptions rectOptions = new PolylineOptions()
	.add(new LatLng(36.144425, 128.393269))
	.add(new LatLng(36.136263, 128.39874))
	.add(new LatLng(36.136523, 128.401895))
	.add(new LatLng(36.13602, 128.407688))
	.color(Color.RED);
	 
	@Override 
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main); 
		mGoogleMap = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.fragment1)).getMap();
		mGoogleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
		mGoogleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(loc, 15));
		mGoogleMap.addMarker(new MarkerOptions().position(loc)
Contextual code suggestions in your IDE  Get Codota for Java