我正在编写一个 GPS 跟踪应用程序。我正在使用 CommonsWare WakefulIntentService 和 AlarmReceiver 从 GPS 安排固定位置。问题是我必须使用 doWakefulWork() 方法是为了与同步阻塞进程一起使用,而我所拥有的是异步非阻塞方法。那么我应该如何使用 LocationListener 中的 onLocationChanged() 和 doWakefulWork() 方法中的 requestLocationUpdates() 来修复 GPS 位置?
解决了:
我刚刚发现这个功能已经在LocationPoller中实现了。