We are developing an application with heavy use of GPS, and we cannot optimize battery life.
Even when the device is not moved, there is significant drainage of the battery , which, according to the code, should not occur.
Here is the code:
locationManager = [[CLLocationManager alloc] init];
locationManager.distanceFilter = 100;
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
[locationManager startUpdatingLocation]
Ideally, we want to start GPS every 20 minutes (if there is no change in location, then save battery) OR every 5 minutes if there is a change in location. According to my developer, this is impossible to do
Previously, we used kCLLocationAccuracyBestthat consume the battery very quickly, and we now use kCLLocationAccuracyHundredMeters.
startUpdatingLocation - this is to get the GPS coordinates. There is another call to startMonitoringSignificantLocationChanges, which should get the coordinates of the AGPS, which I believe will return the coordinates when the mesh tower changes, and therefore quickly drain the battery.
distanceFilter . The minimum distance (measured in meters), the device must move in the transverse direction before the update event occurs. Based on the distance filter, we get the GPS correction from the device, and then send the updated GPS coordinates to the server.
Any help would be greatly appreciated
Thank you!
KB403 source
share