Android:Location.distanceBetween 单位和模拟器未正确发送坐标
大家好,我有两个问题
1)我一直无法找出Location.distanceBetween以哪些单位接收纬度和经度。是度还是微度?返回的距离单位是什么? 很抱歉这个菜鸟问题,但我在文档中找不到任何内容。
2) 在Windows XP 中使用Eclipse 3.3.2。模拟器无法正确发送坐标。无论是手动还是通过加载 gpx 文件,都不会调用 locationListener。我在 Ubuntu 中尝试过同样的代码并且工作正常。有人知道我该如何解决这个问题吗?办公室里没有安装linux,我可以带我的个人笔记本电脑。
非常感谢!
Hy everyone, I have two questions
1) I have not been able to find out in which units Location.distanceBetween receivs the latitude and longitude. Is it degrees or microdegrees? Whats the unit for the distance returned?
Sorry for this noob questions but I have not been able to find anything on the documentation.
2) In windows XP using Eclipse 3.3.2. Emulator does not send coordinates properly. Either it by hand or by loading a gpx file the locationListener is not invoked. This same code I have tried it in Ubuntu and works fine. Does someone know how can I solve this? In the office there is no linux installed and I can take my personal laptop.
Thanks a lot in advanced!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
1)来自android源:
在computeDistanceAndBearing内部有评论说:
我会检查那里
2)
转到:
1) From android source:
And inside computeDistanceAndBearing there is comment that says:
I would check there
2)
Go to:
我遇到了模拟器无法从 ddms 获取位置的问题,结果是因为我有一个非英语语言环境,这似乎把它搞砸了。您可以尝试在 ddms 启动脚本中的 java 启动参数中添加“-Duser.language=en”,看看是否有帮助。该错误在此处
哦,我不知道纬度/经度的输入单位,但根据 api 文档,结果浮点数以米为单位。
I had problems with the emulator not getting locations from ddms and it turned out to be because I had an non-english locale which appears to screw it up. You can try adding "-Duser.language=en" to the start parameters for java in the ddms start script and see if it helps. The bug is here
Oh and I don't know the input units for lat/long but the resulting float is in metres according to the api docs.