title: code to add markers to map using android google maps v2
body: <p>I have lat&amp;long values from database.how to display markers based on lat &amp;long values using android google map api v2.In original android google maps,we display markers based on concept itemoverlay. In v2,I dont know how to display markers. </p>
  
  <pre><code>    dbAdapter.open();
          Cursor points = dbAdapter.clustercall(Btmlft_latitude, toprgt_latitude,
                  Btmlft_longitude, toprgt_longitude, gridsize1);
          int c = points.getCount();
          Log.d("count of points", "" + c);
  
          if (points != null) {
              if (points.moveToFirst()) {
                  do {
  
                      int latitude = (int) (points.getFloat(points
                              .getColumnIndex("LATITUDE")) * 1E6);
                      int longitude = (int) (points.getFloat(points
                              .getColumnIndex("LONGITUDE")) * 1E6);
  
                      mapView.addMarker(new MarkerOptions().position(
                              new LatLng(latitude, longitude)).icon(
                              BitmapDescriptorFactory.defaultMarker()));
  
                  } while (points.moveToNext());
  
              }
          }
          points.close();
          dbAdapter.close();
  </code></pre>
  
  <p>That is mycode.I am getting <strong>lat&amp;long values from database</strong>,but how to add markers based on lat &amp;long values to map.</p>
  
  <p>I read the  android google maps api v2.In that have only give <strong>statically added data of markers</strong></p>