android get latitude and longitude on emulator of android
<p>hi iwant to check lat long of current position in android emulator how to achive this..??it is possible to get current position latitude and longitude on emulator???if yes then what setting is required in emulator?</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    LocationListener ll = new Mylocationlistener();

    boolean isGPS = lm
            .isProviderEnabled(LocationManager.GPS_PROVIDER);

    // If GPS is not enable then it will be on
    if(!isGPS)
    {
        Intent intent = new Intent("android.location.GPS_ENABLED_CHANGE");
        intent.putExtra("enabled", true);
         sendBroadcast(intent);


    }

    lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, ll);
}
private class Mylocationlistener implements LocationListener {
    @Override
    public void onLocationChanged(Location location) {
        if (location != null) {
            Log.d("LOCATION CHANGED", location.getLatitude() + "");
            Log.d("LOCATION CHANGED", location.getLongitude() + "");
            float speed = location.getSpeed();
            double altitude = location.getAltitude();
            Toast.makeText(currentlatlong.this,"Latitude = "+
                    location.getLatitude() + "" +"Longitude = "+ location.getLongitude()+"Altitude = "+altitude+"Speed = "+speed,
                    Toast.LENGTH_LONG).show();
        }
    }

    @Override
    public void onProviderDisabled(String provider) {
    }

    @Override
    public void onProviderEnabled(String provider) {
    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras) {
    }
}
</code></pre>
