2

I am doing a tracking app and it can get positions from CLLocationManager in the background, which brings the danger of eating battery without the user knowing, so I want to save as much battery as possible.

I want the app track "actively" (with locationManager.distanceFilter = 10;) when there are enough satellites to provide GPS positions, but "idle" when the user is indoors (not able to get GPS positions from satellites), or not moving (even with satellites coverage).

The question is how to do the "idle". The [locationManager stopUpdatingLocation]; will completely stop checking location updates, which then have no idea when to switch to "active" tracking.

Anyone have some hints please? Thanks.

4

1 回答 1

0

你看过了吗:CLLocationManager

- (void)startMonitoringSignificantLocationChanges

或者可能

- (void)startMonitoringForRegion:(CLRegion *)region desiredAccuracy:(CLLocationAccuracy)accuracy

于 2010-11-03T15:09:42.907 回答