10

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

asked Oct 6, 2015 at 8:55

2 Answers 2

7

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:

answered Oct 20, 2017 at 13:05
Sign up to request clarification or add additional context in comments.

Comments

6

It seems activityType only affects battery performance while monitoring location. Specifically when it pauses polling location.

Will pause polling when

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.

Reason being

  • 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.

Other notes

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.

answered Jul 12, 2016 at 15:59

1 Comment

Still not so clear for me. For example, when I use AutomotiveNavigation, the location stop updating after stop moving for sometime. Then it will resume updating after I move again?

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.