gpt4 book ai didi

Android 以固定的时间间隔获取 GPS 位置,对电池有多大影响以及后台发生了什么如果我们每小时获取位置

转载 作者:太空狗 更新时间:2023-10-29 13:40:16 25 4
gpt4 key购买 nike

当以固定时间间隔(比如每小时)获取 GPS 位置时,这会每小时、每分钟或仅在实际每小时获取位置或更新位置时耗尽电池电量。我很想知道后台发生了什么。

这是this reference

"Background services should be careful about setting a sufficiently high minTime so that the device doesn't consume too much power by keeping the GPS or wireless radios on all the time. In particular, values under 60000ms are not recommended. "

所以我希望当位置改变时,或者在 minTime 之后,GPS radio 打开,在获取位置后,GPS radio 关闭

有人能证实这是真的吗?

最佳答案

根据 reference我们可以确定当 GPS 引擎尝试获取新位置时会发生昂贵的电池使用,我们可以使用方法控制此频率 public void requestLocationUpdates (long minTime, float minDistance, Criteria criteria, PendingIntent intent)

关于Android 以固定的时间间隔获取 GPS 位置,对电池有多大影响以及后台发生了什么如果我们每小时获取位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6623085/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com