Hello
I have an Android service using location manager:
if(locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
Log.i("service","start with GPS"); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,locationListener);
}
Then the location listener:
private LocationListener locationListener = new LocationListener() {
public void onLocationChanged(Location aLocation) {
Log.i("location listener", "location updated");
}
... other methods ....
}
Authorization for ACCESS_FINE_LOCATION is set in the manifest.
Everything works fine both in the simulator and in the phone (Xperia Android 1.6 to 2.2) for NETWORK_PROVIDER. It works great in the simulator for GPS_PROVIDER. But when I try to use GPS in devices, the location listener is never called. In DDMS, I see that GPS actually works and retrieves locations, but it never calls listener methods. However, there is a strange message:
WARN / libloc_api (1173): loc_eng_report_position: ignore location report when session state = 1
I do not see what I am missing. Any ideas? Thanks.
source share