Android的 - 是否有已轮询GPS定位可查询的服务? [英] Android - Are there query-able services that already poll for GPS location?
问题描述
我为检查您的位置大约每5分钟或更少的应用程序的一些想法。也许每1分钟,我还没有确定。很显然,我可以简单地创建,检查手机的GPS定位,是每个N分钟的服务。但是,这是对电池的潜在流失。
I have some ideas for an app that checks your location about every 5 minutes or less. Maybe every 1 minute, I'm not sure yet. Obviously I can simply create a service that checks what the phone's GPS location is every N minutes. But that is a potential drain on the battery.
我想知道,是否有已经在Android操作系统,已经为手机GPS定位查询运行的任何内部服务?这样,或许我可以简单地问这些服务的位置而不是使GPS位置请求自己是什么,为了节省电池用量。
What I was wondering, are there any internal services that are already running in the Android OS that are already polling for the phones GPS location? That way perhaps I can simply ask those services for what the location is instead of making the GPS location request myself, in order to save on battery usage.
推荐答案
没有这样的系统服务存在。您可以创建一个服务,并定期检查<一href=\"http://developer.android.com/reference/android/location/LocationManager.html#getLastKnownLocation%28java.lang.String%29\"相对=nofollow> lastKnownLocation()
。
No such system services exist. You can create a service and periodically check for lastKnownLocation()
.
设计一个位置感知应用程序依赖于很多因素。试着回答这个问题:
Designing a location-aware app depends on a lot of factors. Try answering this questions:
- 请你总是需要GPS定位或基于位置不够好网络?
- 如何保鲜确实位置需?
- 请你需要的位置,即使用户不移动?
- 请你需要的位置,即使手机处于睡眠模式?
阅读的http:// Android的开发者。 blogspot.com/2011/06/deep-dive-into-location.html
这篇关于Android的 - 是否有已轮询GPS定位可查询的服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!