How to get the current fixed position in emulator?
<p>I'm trying an application that displays the latitude and longitude positions. I tried giving lat. &amp; lon. values using geo fix and even emulator control but I'm not getting the output. Can anyone help me out?</p>

<p>Here's the code and output that i get:</p>

<pre><code>public class LocationTest extends Activity
{
    private LocationManager mgr;
    private TextView output;
    private String best;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mgr = (LocationManager) getSystemService(LOCATION_SERVICE);
        output = (TextView) findViewById(R.id.output);
        StringBuilder sb = new StringBuilder("Enabled Provider:");

        Criteria criteria = new Criteria();
        String provider = mgr.getBestProvider(criteria, true);

        mgr.requestLocationUpdates(provider, 1000, 0,
        new LocationListener()
        {
            public void onLocationChanged(Location location) {}
            public void onProviderDisabled(String provider) {}
            public void onProviderEnabled(String provider) {}
            public void onStatusChanged(String provider, int status, Bundle extras) {}
        });
        sb.append("\n").append(provider).append(":");
        Location location = mgr.getLastKnownLocation(provider);
        if (location != null)
        {
            double lat = location.getLatitude();
            double lng = location.getLongitude();
            sb.append(lat).append(",").append(lng);
        }
        else
        {
            sb.append("No Location");
        }
        output.setText(sb);
    }
}
</code></pre>

<p>Output:</p>

<p>Enabled provider:
gps:No Location</p>
