Wenn der neue Standort innerhalb von - sagen wir mal - 100m des alten Standorts ist, fügen Sie ihn nicht zur Datenbank hinzu.
private static final float SIGNIFICANT_DISTANCE = 100f;
public void onLocationChanged(final Location newLocation) {
if (newLocation != null) {
final Location oldLocation = ; // Get last location from DB/field.
if (oldLocation == null) {
// If this is first measurement
// Add to DB.
} else if (oldLocation.distanceTo(newLocation) > SIGNIFICANT_DISTANCE) {
// If user has moved significantly
// Add to DB.
} else {
// If user hasn't moved significantly
// Ignore it or implement some sort of precision refinement logic and update entry in DB.
}
}
}
Zusätzlich sollten Sie die Überwachung des Standorts aktivieren, wenn die Aktivitätserkennung meldet, dass der Benutzer unterwegs ist.
können Sie GPS verwenden –
Was genau haben Sie versucht? Post-Links. –
Kannst du angeben, was du als Bewegung nimmst? – AxelH