title: How do I calculate the center of a polygon in Google Maps Android API v2?
body: <p>I have drawn a polygon on google map using several Latitude,Longitude points.But now I need to place a marker at the center of the polygon for which I need the center coordinates.How do I calculate the center point.</p>
  
  <p><strong>Below is the code for adding polygons on map:</strong></p>
  
  <pre><code>for (Warning w : warningsList) {
              // Instantiates a new Polygon object and adds points
              PolygonOptions rectOptions = new PolygonOptions();
              List&lt;PolyPoints&gt; pp = w.getPolyPoints();
              for (PolyPoints p : pp) {
                  rectOptions.add(new LatLng(Double.valueOf(p.getLatitude()),
                          Double.valueOf(p.getLongitude())));
              }
  
                  mMap.addPolygon(rectOptions.strokeColor(Color.GREEN)
                          .fillColor(Color.RED).strokeWidth(STROKE_WIDTH));
  
          }
  </code></pre>
  
  <p>I found similar <a href="https://stackoverflow.com/questions/3081021/how-to-get-the-center-of-a-polygon-in-google-maps-v3">question</a> which has been answered but thats for JavaScript Api.Is their any way of using the same solution in my case?</p>