j2ME setLocationListener()
我正在使用在 Sprint 的 IDEN 网络上运行的 Motorola i335 来编写 GPS 跟踪系统。我正在使用 javax.microedition.location api 来查找 GPS 坐标。要设置更新,请使用 [setLocationListener][1] 方法。我最初尝试传递(listener,2,1,1)。然而,接收到的无效位置太多(GPS 无法在指定时间内获得修复),因此我将参数更改为 (listener, 20, 20, 1)。现在系统几乎不会抛出任何无效位置。我的目标是获得最快数量的实际更新。你们中有人找到了此方法参数的合适媒介吗?
[1]: http://www-users.cs.umn.edu/~czhou/docs/jsr179/lapi/javax/microedition/location/LocationProvider.html#setLocationListener(javax.microedition.location. LocationListener, int, int, int)
I'm programming a GPS tracking system using the Motorola i335 running on Sprint's IDEN network. I'm using the javax.microedition.location api to find the GPS coordinates. To set up the updating, you use the [setLocationListener][1] method. I originally tried passing (listener,2,1,1). However there were too many invalid locations being received (where the GPS could not get the fix in the specified time), so I changed the parameters to (listener, 20, 20, 1). Now the system barely throws any invalid locations. My goal is to get the fastest number of updates that are realistic. Have any of you found a happy medium for parameters of this method?
[1]: http://www-users.cs.umn.edu/~czhou/docs/jsr179/lapi/javax/microedition/location/LocationProvider.html#setLocationListener(javax.microedition.location.LocationListener, int, int, int)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我宁愿实施逼真度检查以避免无效的位置数据。
检查提供者状态的可用性并比较最后返回的纬度/经度值应该可以解决问题。
I'd rather implement a verisimilitude check to avoid invalid location data.
Checking the provider state for availability and comparing the last returned lat/lon values should do the trick.