jjzjj

requestSingleUpdate

全部标签

android 后台位置更新和唤醒锁

我正在开发一个Android应用程序,我需要使用GPS提供程序在后台长时间获取位置更新,因此我需要在用户不再与其交互时发生位置更新。我对自己进行了一些测试,比较了LocationManager的requestSingleUpdate(提供者,pendingIntent版本)和requestLocationUpdates(提供者,minTime,minDistance,Intent版本)。在我的DroidRazrHD上获取了大量数据后,看起来使用requestLocationUpdates比requestSingleUpdate可靠得多(对于这两种方法,我实际上将报告的GPS位置与我实际

android - 为 android requestSingleUpdate 设置超时

我正在使用androidLocationManager的例程requestSingleUpdate()重例程带有LocationListener的库.我正在尝试实现的功能是用户可以按下按钮,应用程序将获取他们的当前位置并执行反向地理编码以获取大致地址。我的问题是,根据设备的网络情况,获取位置修复可能需要很长时间。如何实现一个超时,导致我的“requestSingleUpdate()”放弃并告诉用户找出他们自己的血腥地址?我的代码:LocationManagerlocationManager=(LocationManager)getSystemService(Context.LOCATI

android - 为 android requestSingleUpdate 设置超时

我正在使用androidLocationManager的例程requestSingleUpdate()重例程带有LocationListener的库.我正在尝试实现的功能是用户可以按下按钮,应用程序将获取他们的当前位置并执行反向地理编码以获取大致地址。我的问题是,根据设备的网络情况,获取位置修复可能需要很长时间。如何实现一个超时,导致我的“requestSingleUpdate()”放弃并告诉用户找出他们自己的血腥地址?我的代码:LocationManagerlocationManager=(LocationManager)getSystemService(Context.LOCATI