J'ai le problème que mon service qui a la LocationListener implémentée, reçoit un GPSupdate toutes les 500ms il semble. Peu importe ce que minTime j'ai mis dans la fonction requestLocationUpdates.requestLocationUpdates ne met pas à jour sur l'intervalle dans Android
morceau de mon code:
public class LocationService extends Service implements LocationListener {
LocationManager locMan;
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
locMan = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
locMan.isProviderEnabled(android.location.LocationManager.GPS_PROVIDER;
locMan.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 1, this);
}
public void onLocationChanged(Location location) {
Log.d("Loc", "Location has been changed");
}
}
D'un bouton dans mon activité principale i appellera startService(), après cela, il devrait fonctionner en arrière-plan, mais il donne des mises à jour en continu.