-->

iphone - What consumes less battery? Startmonitori

2019-05-10 11:24发布

问题:

I would like you to give me your feedback on which method consumes less battery.

My app will run in the background and will wake up with location changes, so I would like to use the method that consumes less battery.

Any ideas on which one it is?

Thanks

回答1:

Neither of these choices is responsible for more or less battery consumption.

In order for your app to be notified of any location update, regardless of whether it is for a region change or a significant location change, you must specify in your app's Info.plist file that you will require location-services in the background.

There are actually two relevant choices for location services: location-services or gps.

In order NOT to drain the user's battery, choose location-services. If you say your app needs gps background services, you WILL drain the battery because this will cause the GPS hardware (assuming it is present) to be enabled, and THAT is the cause of battery drain. When you specify location-services, the device uses the cellular radio (which is on anyway, assuming you have an iPhone) to pinpoint the location instead. Not as accurate as gps, but most apps don't need GPS accuracy. (If you do, then use gps, of course, but know the consequences vis a vie battery life.)

I recently wrote a test app all about this (and I wrote about it last week here) and what I found was there was no significant battery drain when I had several regions setup for monitoring and I specified location-services as a required background service.