不断监视位置最好的方法最好的、位置、方法

由网友(木偶之春)分享简介:我要定期监测用户的位置,像谷歌纬度一样。一些会唤醒电话每隔X分钟,即使应用程序当前没有运行,得到的位置,并将其发送到服务器。这是后话,用户将不得不选择加入。I want to monitor a user's location on a regular basis, like Google Latitude does...

我要定期监测用户的位置,像谷歌纬度一样。一些会唤醒电话每隔X分钟,即使应用程序当前没有运行,得到的位置,并将其发送到服务器。这是后话,用户将不得不选择加入。

I want to monitor a user's location on a regular basis, like Google Latitude does. Something that would wake the phone up every X minutes, even if the app is currently not running, get the location, and send it to a server. This is something that the user will have to opt into.

使用LocationManager本身并似乎没有要走的路。我想这是形式的跟进问题,这一个:LocationManager每分钟更新,消耗了大量的电池电量

Using LocationManager alone does not seem to be the way to go. I guess this is sort of a follow up question to this one: LocationManager updates every minute, consuming a lot of battery power

好像使用AlarmManager和LocationManager的组合是可行的。

It seems like using a combination of AlarmManager and LocationManager would work.

什么是做到这一点的最好方法是什么?

What is the best way to do this?

推荐答案

我已经试过只使用 LocationManager 此,并没有多少运气。因此,我滚了 LocationPoller 说,在与自己的 _WAKEUP 报警的同时,应处理这种情况。

I've tried just using LocationManager for this and did not have much luck. Hence, I rolled a LocationPoller that, in conjunction with your own _WAKEUP alarms, should handle this scenario.

阅读全文

相关推荐

最新文章