0

pretty clear fromt the title, so far I've tried different coordinates but here is an example of what happens:

telnet localhost <port> Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Android Console: type 'help' for a list of commands OK geo fix 46.498981 11.350230 OK 

while in the logcat I found this couple:

46.491002 11.351833366666664 

when I give this coordinate I read in the logcat from my class implementing location listener (and others for double check):

public class LocationService implements LocationListener { private static final String TAG = "LocationService"; public LocationManager lmr = null; private Navigation SystemService = null; public LocationService(Navigation sservice) { this.SystemService = sservice; } public void startLocationService() { Log.d(TAG, "starting LocationService"); this.lmr = (LocationManager) this.SystemService .getSystemService(Context.LOCATION_SERVICE); this.lmr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 3000, 5, this); } public void stopLocationService() { this.lmr.removeUpdates(this); } /* * (non-Javadoc) * * @see * android.location.LocationListener#onLocationChanged(android.location. * Location) */ @Override public void onLocationChanged(Location location) { location = this.lmr.getLastKnownLocation(LocationManager.GPS_PROVIDER); try { // this code is used to make a location used from the server I am communicating with out of a android.location eu.fbk.dycapo.models.Location loc = new eu.fbk.dycapo.models.Location(); Log.d(TAG, "longitude : " + location.getLongitude()); Log.d(TAG, "latitude : " + location.getLatitude()); loc.setGeorss_point(String.valueOf((double) location.getLongitude()) + " " + String.valueOf((double) location.getLatitude())); loc.setLeaves(Calendar.getInstance().getTime()); loc.setPoint(eu.fbk.dycapo.models.Location.POSI); //send it to the server LocationService.updatePosition(loc); } catch (NullPointerException e) { Log.e(TAG, e.getMessage()); e.printStackTrace(); } } /* * (non-Javadoc) * * @see * android.location.LocationListener#onProviderDisabled(java.lang.String) */ @Override public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see * android.location.LocationListener#onProviderEnabled(java.lang.String) */ @Override public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } /* * (non-Javadoc) * * @see android.location.LocationListener#onStatusChanged(java.lang.String, * int, android.os.Bundle) */ @Override public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } 

I think there's something it might be wrong somewhere but I don't understand where nor why, since I've followed android guidelines to implement location listeners here.
thanks

1 Answer 1

1

It's a known bug in the emulator I'm afraid, see:

link text

I (and many others) have the same problem.

Sign up to request clarification or add additional context in comments.

2 Comments

thanks I'm also targeting a avd 1.6 . Just to be sure it will work on a real device, or should I switch to >=2.0?
Apparently it works fine on real devices according to other posters. Just as well really, as if you were walking near a cliff edge in the fog and relying on the device, it could be tricky. It's probably down to the latest releases of the ADT plugin, it works OK with 0.9.6 allegedly. I'm on 0.9.9 and it's not really practical to go back.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.