Search code examples
androidiphonegpstriangulation

iOS vs Android Location tracking with precision and battery consumption


I tried an Android device with GPS module OFF. I was driving in a car and horizontal accuracy was from 50-300m which is accuracy that is OK with me. (triangulation + wi-fi)

I am trying to build an iPhone application which uses as little battery as possible (application will be on the hole day).

Thats why I would not like to use GPS. Will hundredMeters accuracy use GPS or it works with triangulation?

locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;

I also wonder how much is distanceFilter important to battery consumption? Is there a huge difference if it is set to 300m or 1000m?


Solution

  • I am trying to build an iPhone application which uses as little battery as possible (application will be on the [whole] day).

    Then you should be leveraging the Significant-Change Location Service if at all possible, as this is the most power efficient method of getting long-term location data in your application. This is also the most effective way to get location update into your app while it is in the background (something you might have taken for granted on Android).

    Also from the iOS Core Location docs:

    Use lower-resolution values for the desired accuracy unless doing so would impair your app. ...remember that specifying a value of kCLLocationAccuracyThreeKilometers does not prevent the location service from returning better data. Most of the time, Core Location can return location data with an accuracy within a hundred meters or so using Wi-FI and cellular signals.

    It is likely based on this that the constant kCLLocationAccuracyHundredMeters does not typically require the GPS to be turned on, but you might reduce your requested accuracy to ensure the GPS if left off, and iOS will likely still deliver to you data that is accurate within the range you prefer.

    I also wonder how much is distanceFilter important to battery consumption?

    This filter is involved more in how often updates are actually delivered to your app, the accuracy deals more with the hardware that will be required to get the fix. A filter will reduce how often radios are turned on, but this is a larger power saving tool when GPS is involved. If you are using the Significant-Change service, however, this part of the question is irrelevant.