1

I want to slow the update rates as soon as I got a location precise enough for my needs:

    @Override
public void slowUpdateRate() {
    /*
     * Set the update interval 
     */
    Dbg.v(TAG,"****************************");
    Dbg.e(TAG, "-- SLOW update rate");
    Dbg.v(TAG,"****************************");
    stopUpdates();
    mLocationRequest.setInterval(1500000);
    mLocationRequest.setFastestInterval(150000);
    mLocationClient.requestLocationUpdates(mLocationRequest, this);

The method is called but I still got updates every 3 seconds and a half. I have a ViewPager with a maps 2.0 fragment but I did mapFragment.getMap().setMyLocationEnabled(false);

How do I slow updates? Why FastestInterval is not working?


EDIT: I test my slow updates on the dummy application provided by Google docs and it works ok. I added a LogCat getFastestInterval and getInterval and I got the 15 and 30 seconds I was expecting in the test context. BUT the update rate is still freaking too high.

Poutrathor
  • 1,990
  • 2
  • 20
  • 44

1 Answers1

2

I got this !

The mistake is mine and can be resume in this

DO NOT CALL AGAIN mLocationClient.requestUpdates(mLocationRequest,this);

Also, remember that the default fastest interval is your normal interval/6 .

Poutrathor
  • 1,990
  • 2
  • 20
  • 44
  • [LocationClient](https://developer.android.com/reference/com/google/android/gms/location/LocationClient.html) is deprecated. Look at this answer for current options: [LocationManager or Location Service API](http://stackoverflow.com/questions/24266362/android-google-maps-api-location/27195920#27195920) – MiguelHincapieC Nov 28 '14 at 21:48
  • 1
    thanks for commenting. Was it deprecated one year ago ? Right now I am using LocationManager. note, you have to considered that the new FusionLocation api are part of Google services which might not be available for some projects. – Poutrathor Dec 01 '14 at 12:51