Get the center coordinates of map in Android Mapview 
<p>In my application I'm trying to get the center coordinates of map when user scroll around the map.</p>

<p>I want to get the co-ordinates and set it on the text view.</p>

<p>Here is my code for that:</p>

<pre><code>public boolean onTouchEvent(MotionEvent event) {
        int action=event.getAction();
        projection=mapView.getProjection();
        int X = (int)event.getX();          
        int Y = (int)event.getY();
        if(action==MotionEvent.ACTION_MOVE)
        {


            metrics = new DisplayMetrics();
            getWindowManager().getDefaultDisplay().getMetrics(metrics);

            GeoPoint G = projection.fromPixels(metrics.heightPixels/2, metrics.widthPixels/2);
        //GeoPoint p=   mapView.getMapCenter();
            int lati=p.getLatitudeE6();
            Log.i("Lat : ",""+lati);
            Toast.makeText(this,""+lati,Toast.LENGTH_LONG);

            int longi=p.getLongitudeE6();
            Log.i("Lon : ",""+longi);
            Toast.makeText(this,""+longi,Toast.LENGTH_LONG);
            lat.setText(""+lati);
            lon.setText(""+longi);
        }
        return true;
    }
</code></pre>
