持续记录位置的最佳方式
我正在寻找持续监控 Android 设备位置的最佳方法,同时使用最少的电池电量。我的项目基本上是一个电话跟踪服务,包括电话/短信记录和位置跟踪。有一个网络界面,最终允许人们更改设置(例如位置更新间隔,这样如果它被盗,他们可以更有效地跟踪它),但作为标准,它应该每 30-60 分钟更新一次位置。
我正在考虑使用服务,但启动服务、请求位置更新,然后完成会更好吗?或者其他方法?
干杯
I'm looking for the best way to continually monitor the location of an Android device, while using the lowest amount of battery power. My project is basically a phone tracking service, with phone call / sms logging, and location tracking. There is a web interface, which would eventually allow a person to change settings (such as location update interval, so if it was stolen they could track it more effectively), but as standard it should update the location every 30-60 minutes.
I was thinking of using a Service, but would it be better to start a service, request location updates, and then finish? Or some other method?
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,只是为了让您不需要一直保持服务。然而,情况比这更复杂:
我有一个
LocationPoller
处理最多的组件的。Yes, simply so you do not need to keep a service around all the time. However, it's a bit more complicated than that:
I have a
LocationPoller
component that handles most of that.