What is the difference between those values:
CLActivityTypeAutomotiveNavigation,
CLActivityTypeFitness,
CLActivityTypeOtherNavigation,
When assigned to activityType
property of CLLocationManager
?
Documentation suggest that I should use them according to my purpose of using CLLocationManager, but I gives no hint about difference in algorithm that determine halting location updates.
Quote from documentation:
CLActivityTypeAutomotiveNavigation
[...] This activity might cause location updates to be paused only when the vehicle does not move for an extended period of time.
CLActivityTypeFitness
[...]This activity might cause location updates to be paused only when the user does not move a significant distance over a period of time.
CLActivityTypeOtherNavigation
This activity might cause location updates to be paused only when the vehicle does not move a significant distance over a period of time.
I really cannot see the difference between those descriptions.
Documentation Source:
https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/#//apple_ref/c/econst/CLActivityTypeOther
It seems activityType
only affects battery performance while monitoring location. Specifically when it pauses polling location.
AutomotiveNavigation
- Not moved at all in a long time.
OtherNavigation
(e.g. boat / train) - Not moved much in a long time.
Fitness
- Not moved much in a shorter period of time.
Other
- Presumably will not stop polling.
For boats or trains they may have stopped, but you could still be walking around inside them so you don't really care about these small updates.
For fitness you might have stopped your run but you are still moving around in your house... You don't really want to keep draining your battery.
The docs for pausesLocationUpdatesAutomatically further suggest that the activityType
only determines if location updates should be automatically paused.
You can help the determination of when to pause location updates by assigning a value to the activityType property.
Not only does the activityType
affect battery life as specified by Robert's answer and Apple official documentation, it might also affect the way in which the coordinates returned might be "snapped" to the closest road under certain conditions.
In short, if you're not using activity type "Other Navigation", and if the location is changing fast (= you're on a vehicle fast enough), and somehow your phone is able to get the information needed through Internet or a local cache, the locations reported by the manager will not be accurate, as they'll be "snapped" to the closest road.
This issue has been reported for all versions of iOS since iOS 6. And the issue seems to appear also if any instance of the locations manager running on the entire system has been set up with an activity type that is not "other navigation": note that the default for that property is "other", which is not the same as "other navigation".
Some references:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With