Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why did didupdatelocation be called when device is not moved

i use CLLocation for a app that record people's trace in map view when they are running or walking ,but i found when my device is still (not moved) ,the - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations is also get called frequently ? currently ,my locationmanager's desiredAccuracy is 10 meters and distanceFilter is 10.

how to deal with this situation? I have tried use big distancefilter value(like 150) ,but I found if i do this, then i can't record exactly when people is running or walking

like image 928
ximmyxiao Avatar asked Dec 27 '22 09:12

ximmyxiao


2 Answers

GPS is not exact. You can move around a few feet and get the same location. Or you can sit still and get told you have moved a few feet.

You might be able to combine measurements from the accelerometer to determine if you have really moved but this would only work if the device was sitting on a table not moving.

like image 77
rmaddy Avatar answered Feb 22 '23 23:02

rmaddy


Have you called stopUpdatingLocation after the initial startUpdatingLocation? It will keep updating location if you do not call it.

like image 43
Tommy Devoy Avatar answered Feb 23 '23 00:02

Tommy Devoy