不断监视位置最好的方法 [英] Best way to constantly monitor location

查看:102
本文介绍了不断监视位置最好的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要定期监测用户的位置,像谷歌纬度一样。一些会唤醒电话每隔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本身并似乎没有要走的路。我想这是形式的跟进问题,这一个:<一href="http://stackoverflow.com/questions/5846441/locationmanager-updates-every-minute-consuming-a-lot-of-battery-power">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.

这篇关于不断监视位置最好的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆