0

Let's assume I'm used the Android fused location API to request highly accuracy location reporting. For example,

    mLocationRequest = new LocationRequest();
    mLocationRequest.setInterval(FASTEST_UPDATE_INTERVAL*2);
    mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL);
    mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);

    LocationServices.FusedLocationApi
                .requestLocationUpdates(mGoogleApiClient, mLocationRequest, this)

This results in my location listener getting called up to every FASTEST_UPDATE_INTERVAL. If I set FASTEST_UPDATE_INTERVAL to be short I know that the GPS radio will not be turned off between location updates. I know this from various sources such as Fused Location Provider unexpected behavior and https://www.quora.com/Why-does-GPS-use-so-much-more-battery-than-any-other-antenna-or-sensor-in-a-smartphone.

My question is what is the smallest value of FASTEST_UPDATE_INTERVAL that will result in the GPS radio being turned off between location updates?

I anticipate there will not be a clear answer to this question, and that it will depend on the phone hardware, the Google Play version and probably other hardware and software factors. Nonetheless a general answer would be helpful.

This question is important because I am interested in using high accuracy locating but minimizing battery use. To a point I am happy to increase FASTEST_UPDATE_INTERVAL if it will save power.

Wouldn't it be nice if the google fused location services used the device's motion detectors (if they exist) to work out when it was stationary and if so simply turned off the GPS radio until the device moved.

Community
  • 1
  • 1
pbm
  • 5,081
  • 4
  • 18
  • 31

1 Answers1

0

Even if you found an answer, I wouldn't count on it remaining the same between devices, OS versions, or Google Play versions. If you absolutely don't want GPS, don't used the fused provider. Use the network provider from the base LocationManager.

As for using motion detectors- they don't exist. It has an accelerometer, but to an accelerometer staying still and traveling at a constant 50mph look exactly the same (traveling at constant speed is 0 acceleration). It might not be a good optimization anyway- getting a lock on multiple GPS satellites takes several seconds. You don't want to keep turning that on and off if someone wants accuracy.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127
  • You may be correct about motion detectors not existing in the current crop of devices. But they will exist very soon if they are not already in use. There are many sensor fusion coprocessors that do detect motion, and I know of one silicon company integrating them into their ASICs. One example is http://www.pnicorp.com/products/sentral-sensor-fusion/ that fuses gyroscopes, accelerometers and magnetic sensors. Your point stands nonetheless for current devices, so we cannot expect Android to yet use for motion detection as part of its fused location software. – pbm Mar 06 '16 at 01:29
  • Possibly, if the OEMs think that there's enough of a use for them to give them a competitive advantage. But even if every OEM decides to put them in all their flagship devices in late 2016, it won't hit a majority of devices for a half decade based on average turnover rate. For now, they don't exist. I'm also very curious how you think they'd do constant motion because gyros, accelerometers, and magnetosensors can't. – Gabe Sechan Mar 06 '16 at 01:33
  • A fully fused location service that uses GPS, gyros, accelerometers and magnetosensors could easily detect constant motion. Its all in the software algorithm. Let's assume all sensors are enabled and you receive three accurate GPS readings 10 seconds apart that tell you there is some constant motion. You can now assume this motion remains constant until the other sensors tell you otherwise. You can turn off the GPS radio until the other sensors indicate a motion change. – pbm Mar 06 '16 at 01:56
  • You'd need far more accurate and less noisy sensors than phones have today. The accelerometer in particular. Nor can you just turn GPS on and off like that- acquiring a signal takes seconds to minutes, making a correlation difficult.. You're better off just leaving GPS on. – Gabe Sechan Mar 06 '16 at 01:59