我正在开发一款应用程序,可以记录用户通过一天的位置,以便应用程序可以找出用户的近似生活方式。应用程序必须以一定的时间间隔在后台收集数据,所以我需要一个最佳策略来调用android的位置管理器的位置更新请求。但它必须在电池方面进行优化,并在精度方面保持平衡。全天记录用户的位置/移动
现在在我心中流,
iterate through the location providers, give higher priority to NETWORK (as it consumes less power), o this for each,
get the last known location
get the current loction
chek if current is better than last
if yes make this the best estimate, otherwise get location from other provider
我知道两个参数可以决定何时调用位置更新请求,
minimum interval
minimum distance
首先我会给他们一些默认值,但这些必须稍后通过使用用户的位置历史记录并考虑到其他因素考虑在内,例如
reduce the frequency of update request if battery is < 75% and further reduce it when
battery is < 50%
increase frequency of update request when user is moving fast (Activity Recognition Class
from google location services can help here)
if we predict the time windows in which user does not move (from history), decrease the
frquency of location updates
use GPS minimal time because it consumes more battery
所以这些是我想到的,但现在看起来像一团糟,因为它没有很好的结构。所以如果有人可以帮助我添加更多的东西,或者可以提出一些更好的策略(电池必须优化),我会非常感激,并且它很长,所以请控制你的情绪,如果你认为我浪费了你的时间。谢谢