iOS/Android GPS 电量消耗?

发布于 2024-09-13 05:58:20 字数 667 浏览 3 评论 0原文

我正在研究为 Android/iOS4/两者编写一个在后台使用 GPS 的应用程序的可能性。我找到了 iphone 开发者文档的“在后台接收位置事件” 部分,建议我只注册“重大位置更改”事件。我不知道 Android SDK 中有任何此类功能,但如果可以的话,这样做似乎仍然是一个好主意(以免耗尽电池)。

我的问题是:有没有人在 iPhone/Android 手机上对此做过任何类型的基准测试?到目前为止,我已经看到很多帖子/文档说在后台监听 GPS 事件是一件非常糟糕的事情,我应该不惜一切代价避免它,但我还没有找到任何数字到底有多少监听 GPS 变化的后台应用程序会消耗电量(即每次应用程序在后台运行时的电池消耗百分比)。

此信息可能对我(也可能对其他人)有帮助,因为我可能能够降低轮询频率,甚至可以根据电量消耗注册/取消注册我的 GPS 监听器。本质上,我可以尝试为我的应用程序在后台消耗的电池寿命设定一个上限。

谢谢!

I'm investigating the possiblity of writing an app for Android/iOS4/both that would use GPS in the background. I found the "Receiving Location Events in the Background" section of the iphone developer documentation, which recommends that I only register for "significant location change" events. I'm not aware of any such capability in the Android SDK, but it still seems like a good idea to do it this way if I can (so as not to drain the battery).

My question is this: has anyone done any sort of benchmarking for this on and iPhone/Android phone? So far, I've seen a lot posts/documentation saying that listening for GPS events in the background is a VERY BAD THING and I should AVOID IT AT ALL COSTS, but I haven't been able to find any numbers for just how much power a background application listening on GPS changes would drain (i.e. % battery drain per time app is running in the background).

This information might be helpful for me (and possibly others too) because I might be able to poll less frequently or even register/unregister my GPS listener based on power drain. Essentially, I could try to put a ceiling on how much battery life my app could drain while in the background.

Thanks!

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

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

发布评论

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

评论(1

洒一地阳光 2024-09-20 05:58:20

Android SDK 中存在显着的位置变化,

当您订阅获取位置更新时,您可以添加必须在广播之间传递的 minTimeminDistance

public void requestLocationUpdates (String provider, long minTime, float minDistance, LocationListener listener)

查看该方法的描述 [此处][1]

[1]: http ://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(java.lang.String, long, float, android.location.LocationListener)

The significant location change is present in Android SDK

when you subscribe to get location updates you can add a minTime and minDistance that must pass between broadcasts

public void requestLocationUpdates (String provider, long minTime, float minDistance, LocationListener listener)

check out the description of the method [here][1]

[1]: http://developer.android.com/reference/android/location/LocationManager.html#requestLocationUpdates(java.lang.String, long, float, android.location.LocationListener)

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