Excessive Battery Consumption, GPS the cause?

3061
2
11-26-2014 11:10 AM
EricDaniel
Occasional Contributor III

We are noticing a pretty large battery drain when using our iOS app.  The app utilizes the GPS a fair amount and wondering if that doesn't have alot to do with it.  Would it help to have an icon to toggle off the GPS so that it completely turns off the use of the GPS, or is that even possible?  I'm not seeing anywhere in the Guide or API which mentions the GPS is completely being turned off, but only where the location icon shows or not.

0 Kudos
2 Replies
AlPascual
Esri Contributor

xCode has a great instruments that allows you to look at what is consuming power while running the app. I would recommend to open xCode -> Developer Tools -> Instruments and select System Usage, then as you run your app you can see the monitors. You can go to Library and drag and drop the GPS to monitor that as well. It will give you the power state of the GPS.

In the ArcGIS Runtime SDK for iOS you can also stop using the GPS by going to the locationDisplay and call the method Stop. [self.mapView.locationDisplay stopDataSource];

Hope this helps

Displaying the location on a map—ArcGIS Runtime SDK for iOS | ArcGIS for Developers

Cheers

Al

0 Kudos
MichaelDavis3
Regular Contributor

From experience the answer is probably yes - the GPS is causing battery drain.  For our survey apps where the GPS is burning full time (aerial survey and the like) we see device life cut almost in half.  To mitigate we usually tell our field crews to bring along cabling to connect to vehicle power (12v port) or we include one of those cheap monoprice battery boosters.

That said - there is a lot you can do to optimize battery life by switching the GPS off when you don't need it.  Even when we are doing stuff like collecting a track log we've found we can flip the GPS on in the background, wait for the accuracy to settle down, add a point to the log, and then shut it down until we want to add another point.

It would be fantastic if ESRI posted a sample with the tracking code they use in the newer versions of Collector, would love to know if they have any tricks for maintaining the balance between power usage and tracking capabilities.

0 Kudos