iPhone 显着位置变化会导致电池耗尽吗?

发布于 2024-10-27 03:18:19 字数 258 浏览 1 评论 0原文

问题:重要位置变更后台服务是否容易耗尽电池电量?当位置发生重大变化时,我试图跟踪经度纬度读数。然而,在开始之前,我只想确保这不会耗尽电池。

如果上述位置服务不会耗尽电池,有人可以推荐一种存储位置更改的方法,以节省电池电量。我最初的想法是将经纬度点存储在 iPhone 本地,然后以较低的频率(2 小时)将信息发送到服务器。有人有更好的方法吗?

我正在尝试构建一个简单且省电的位置跟踪应用程序。谢谢大家。

Question: Does the Significant Location Change background service drain battery easily? I'm trying to track longitude latitude readings when the there is a Significant Location Change. However, before starting, I just want to make sure that this doesn't drain the battery.

If the Location service described above does not drain battery, can someone recommend a way to store the location changes that would be battery efficient. My initial thought was to store the longitude latitude points locally on iPhone and then send the information to the server on a much less frequent basis (2 hours). Anyone have a better approach?

I'm trying to build a simple location tracking app that is battery efficient. Thanks all.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

超可爱的懒熊 2024-11-03 03:18:19

显着的位置变化不会消耗任何额外的电池电量,因为设备使用 GSM 系统正在使用的信息。无论如何,它必须始终跟踪多个蜂窝塔的信号强度读数。仅当满足某些条件时,您的应用程序才会启动/唤醒。

为了节省电池,您必须注意两个子系统:

  • 确保 CoreLocation 在您不需要时关闭,GPS 占用最多
  • 确保将位置数据突发发送到服务器,以允许发射器断电。

2 小时可能太多了,因为用户可能会终止应用程序,然后永远不会进行更新。或者,如果您实现离线队列,它们只会在下次启动应用程序时发送。但这取决于您的具体场景。

Significant location changes do not take any extra battery draining because the device uses information that the GSM system is working with anyway. It has to keep track of signal strength readings of multiple cell towers all the time anyway. Your app is only started/woken when certain criteria are met.

To conserve battery you have to watch two subsystems:

  • make sure that CoreLocation is turned off when you don't need it, GPS takes the most
  • make sure that you send location data to your server in bursts, to allows the transmitter to power down.

2 hrs might be too much because the user might be terminating the app and then the updates would never be made. Or if you implement an offline queue, they would only be sent next time the app is started. But that depends on your specific scenario.

依 靠 2024-11-03 03:18:19

它应该是蜂窝塔三角测量,而不是 GPS 定位,这足以满足您的需求。它根本不应该很重。
与上传位置相同,很少这样做就可以了。

编辑:将核心位置与重要位置混淆。

It should be cellular tower triangulation, and not GPS location, which is more than enough for your needs. It shouldn't be battery heavy at all.
Same with uploading the location, do it rarely and you are fine.

Edit: Confused Core Location with Significant Location.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文