Does setting "activityType" make sense?

I'm wondering if setting the correct activityType after initializing CLLocationManager will make the location results more accurate.

locationManager = CLLocationManager()
locationManager.distanceFilter = 20
locationManager.activityType = .fitness

Yes it does. activityType determines how CoreLocation will handle raw location data before transferring it to the app.

Two main things that this effects are:

  • correcting the location data to known roads (for navigation, and also fitness), expecting unusual movements (airborne), and so on. If the activity type matches the type of movements, the results will be more accurate. If you require uncorrected data as it comes, the choose default
  • determining when to automatically stop updates (in the old API) and when to set/unset “stationary” (in the new API).

So, yes, this is a meaningful property.


Argun Tekant /  DTS Engineer / Core Technologies

Does setting "activityType" make sense?
 
 
Q