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