Note that there are some explanatory texts on larger screens.

plurals
  1. POGPS doesn't work for short distances
    primarykey
    data
    text
    <p>I'm using an application that uses the gps feature (using AVD on Eclipse). This application works fine when i put the coordinates with the DDMS, but if I insert a point that is very close to the previous point (20-30m), the <code>onLocationChanged(Location loc)</code> event is not called (but the application doesn't crash. If I insert a new point that is not so close, the even is correctly called). Is this an emulator's problem? Or is it a problem caused by the <code>requestLocationUpdates(...)</code> method? My code is this:</p> <pre><code>public class myActivity extends Activity { private TextView mytext; private LocationManager locmgr = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); GPSListener gpsListener=newGPSListener(); mytext = (TextView) findViewById(R.id.mytext); //grab the location manager service locmgr = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locmgr.requestLocationUpdates(locmgr.GPS_PROVIDER, 10, 10, gpsListener); mytext.setText("waiting for location"); } //Start a location listener private class GPSListener implements LocationListener { public void onLocationChanged(Location loc) { //sets and displays the lat/long when a location is provided String latlong = "Lat: " + loc.getLatitude() + " Long: " + loc.getLongitude(); mytext.setText(latlong); } public void onProviderDisabled(String provider) { } public void onProviderEnabled(String provider) { } public void onStatusChanged(String provider, int status, Bundle extras) { } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload