iOS/Android GPS 电量消耗?
我正在研究为 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Android SDK 中存在显着的位置变化,
当您订阅获取位置更新时,您可以添加必须在广播之间传递的
minTime
和minDistance
查看该方法的描述 [此处][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
andminDistance
that must pass between broadcastscheck 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)