Hi all, I'm trying to access location data in the emulator but always receive null values :( This is the code:
final LocationManager locationManager = (LocationManager) getSystemService( Context.LOCATION_SERVICE ); if ( locationManager == null ) { return; } final Criteria criteria = new Criteria(); criteria.setAccuracy( Criteria.ACCURACY_FINE ); criteria.setBearingRequired( false ); criteria.setSpeedRequired( false ); criteria.setAltitudeRequired( false ); criteria.setPowerRequirement( Criteria.NO_REQUIREMENT ); final String provider = locationManager.getBestProvider( criteria, false ); final Location loc = locationManager.getLastKnownLocation( provider ); As described here<http://developer.android.com/guide/topics/location/index.html> I've set a fixed position using the geo command on the telnet console but getLastKnownLocation() always returns null. My app has the following permissions set ACCESS_MOCK_LOCATION ACCESS_COARSE_LOCATION ACCESS_FINE_LOCATION Is there anything else that I'm missing? Many thanks! Regards, Sven -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.