Android在后台获取GPS位置

时间:2013-09-17 13:52:53

标签: android gps

即使应用程序在后台运行,有没有办法跟踪gps位置?

1 个答案:

答案 0 :(得分:2)

是的,创建一个Service并在那里请求位置更新。 这应该指向正确的方向:http://niravranpara.blogspot.se/2013/04/android-get-current-gps-location.html

@Override
public void onLocationChanged(Location location) {
    // here you get location updates
    // the link I gave you doesn't tell u that, but it is obvious?
}