有谁知道 LocationManager 上的 Android addProximityAlert 是否耗电
我基本上只是想添加大约 20 个,有时是 80 个接近警报,且半径约为 500 米,且没有时间限制。 只是想知道这样做是否会很快耗尽电池电量? 减小半径也会有什么不同吗?
I just basically want to add about 20 and sometimes 80 Proximity Alerts with no time expiration with a radius of around 500 meters.
Just wondering whether by doing this will suck up the battery real quick? also would it make any difference by reducing the radius?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这肯定会很快耗尽你的电池。 在任何情况下,您都不想设置超过几个接近警报,您描述的用例并没有在接近警报中真正得到满足。
接近警报应根据需要在 GPS 和网络之间切换,但根据我的经验,只要 GPS 可用,它们往往会坚持使用 GPS,因此您的电池会受到影响。
更好的替代方案是使用警报和服务根据需要对照 20 到 80 个位置集检查您当前的位置。 这将让您可以在一处管理您想要使用的 LBS(GPS 或 Cell ID)以及检查频率。 这样做可以让您更有效地管理电池的使用。
This will definitely eat your battery real quick. You never want to be setting more than a couple of proximity alerts in any case, the use-case you describe isn't really catered for in Proximity Alerts.
Proximity Alerts should switch between GPS and Network as required, but in my experience they tend to stick to GPS whenever it's available, and your battery will suffer as a result.
A better alternative would be to use an Alarm and a Service to check your current location against your set of 20 to 80 locations as required. This will let you manage the LBS you want to use (GPS or Cell ID), as well as the frequency of checks, all in one place. Doing it this way will let you manage your battery use much more effectively.