iPhone-消耗更少的电池?StartmonitoringLocationsChanges或startmonitoringforregion? [英] iphone - What consumes less battery? StartmonitoringLocationsChanges or startmonitoringforregion?

查看:72
本文介绍了iPhone-消耗更少的电池?StartmonitoringLocationsChanges或startmonitoringforregion?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望您能就哪种方法消耗较少的电池给我您的反馈意见.

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.

关于哪个是哪个主意?

谢谢

推荐答案

这两种选择都不会对电池消耗造成多少影响.

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

为使您的应用收到任何位置更新的通知,无论是区域更改还是重大位置更改,您都必须在应用的Info.plist文件中指定需要 location-服务.

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.

对于定位服务,实际上有两个相关的选择:定位服务 gps .

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

为了不浪费用户的电池,请选择位置服务.如果您说您的应用需要 gps 后台服务,则将耗尽电池电量,因为这将导致GPS硬件(假设存在)被启用,这就是电池电量耗尽的原因.当您指定 location-services 时,设备将使用蜂窝无线电(无论如何,如果您有iPhone,它都在运行)来精确定位位置.精度不如 gps ,但是大多数应用程序都不需要GPS精度.(当然,如果使用,请使用 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.

这篇关于iPhone-消耗更少的电池?StartmonitoringLocationsChanges或startmonitoringforregion?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆