I am using my emulator in Basement. This code is running .but the map not showing the current location. I also tried to send the lat long from emulator control but the emulator control showing the wrong lat lon.
package com.maps;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MapView view= (MapView) findViewById(R.id.mapView) ;
view.setBuiltInZoomControls(true);
final MapController control=view.getController();
LocationManager manager=(LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
LocationListener listener=new LocationListener() {
public void onStatusChanged(String provider, int status, Bundle extras) {
}
public void onProviderEnabled(String provider) {
}
public void onProviderDisabled(String provider) {
// TODO Auto-generated method stub
}
};
manager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, listener);
}
@Override
protected boolean isRouteDisplayed()
{
return true;
}
}
For fetching the GPS, you have to be in open field for first time while starting the application. Basement is fully covered area, so it would hard for GPS hardware like mobile’s to fetch the GPS location. However GPS hardwares which are in Cars can fetch GPS signal from basement too.
The alternate way for this requirement is to fetch the cell-id and pass it to the google’s reverse Api, which will give you lat-lon in the result. You can get cell-id from anywhere, an you can see that you have coverage in basement too. Also you can visit my recent answer for more detail regarding GPS in Emulator. Also you can download an example GPX file from here