Difference between CLActivityType Values ​​- iOS SDK

What is the difference between these values:

CLActivityTypeAutomotiveNavigation, CLActivityTypeFitness, CLActivityTypeOtherNavigation, 

When assigning activityType property to CLLocationManager ?

The documentation suggests that I should use them in accordance with my purpose of using the CLLocationManager, but I do not find any hint of a difference in the algorithm that determines the stop of location updates.

Quote from the documentation:

CLActivityTypeAutomotiveNavigation

[...] This action may cause the location update to be suspended only when the vehicle is not moving for a long period of time.

CLActivityTypeFitness

[...] This action may cause the location update to be suspended only when the user does not move a significant distance over a period of time.

CLActivityTypeOtherNavigation

This operation may only suspend location updates when the vehicle does not travel a considerable distance for a certain period of time.

I really do not see the difference between these descriptions.

Documentation Source:

https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/#//apple_ref/c/econst/CLActivityTypeOther

+7
ios cllocationmanager location
source share
2 answers

ActivityType seems to only affect battery performance when tracking location. In particular, when he pauses the location of the survey.

Polling will be suspended when

AutomotiveNavigation - Does not move at all for a long time.

OtherNavigation (e.g. boat / train) - does not move much for a long time.

Fitness - Did not move for a shorter period of time.

Other - Presumably the survey will not stop.

Cause

  • For boats or trains, they may have stopped, but you can still walk inside them, so you don't need these small updates.

  • For fitness, you may have stopped your run, but you are still moving around in your home ... You really do not want to continue draining your battery.

Other notes

The docs for pausesLocationUpdatesAutomatically also indicate that activityType only defines automatic suspension of location updates.

You can help determine when to pause location updates by assigning a value to the activityType property.

+3
source share

Not only does activityType affect battery life, as indicated by Robert and Apple's official documentation, it can also affect how the returned coordinates can be “tied” to the nearest road under certain conditions.

In short, if you do not use the activity type “Other navigation”, and if the location changes quickly (= you are on the vehicle quickly enough), and somehow your phone will be able to obtain the necessary information via the Internet or local cache, locations, which the manager reports will not be accurate, as they will be “tied” to the nearest road.

This issue has been reported for all versions of iOS with iOS 6. And the problem seems to also appear if any instance of the location manager running on the entire system has been configured with an activity type that is not “other navigation” ": note that the default value for this property is "different", which does not match the "other navigation".

Some links:

0
source share

All Articles