简体   繁体   English

如果我发送模拟位置,为什么Android模拟器不正确?

[英]Why is the android emulator innaccurate if i send a mock location?

I just send some coordinates to the android emulator. 我只是将一些坐标发送到android模拟器。

I used this commands for sending the fixes: 我使用以下命令发送修订:

geo fix 8.494062000 52.038213000

This will send my emulator near the bielefeld university in the google maps app. 这会将我的模拟器发送到Google地图应用中的比勒费尔德大学附近。 The next command I issued was: 我发出的下一个命令是:

geo fix 8.495543000 52.038180000

Sadly my position does not change on the emulator. 遗憾的是,我的位置在模拟器上没有改变。 Even mytracks tells me in the logcat output that the position of the user has not changed. 甚至mytracks在logcat输出中也告诉我用户的位置没有改变。

geo fix 8.501787000 52.036614000 

and

geo fix 8.508524000 52.033138000

don't do anything either. 也不要做任何事。 And if the position changes it is nowhere near the position I recoreded the track at. 而且,如果位置发生变化,则距离我重新确定轨迹的位置也不远。 All this coordinates are picked from a track that I recorded with my motorola droid with mytracks on a multiple kilometer streetcar ride. 所有这些坐标都是从我用Motorola droid在多公里路面电车上使用mytracks记录的轨迹中选取的。 Loading the gpx file in google earth displays a neat and accurate overlay over the streetcar line. 在Google Earth中加载gpx文件会在路面电车线上显示整洁且准确的叠加层。 Playing the track as a gpx file gives me similar results. 将曲目作为gpx文件播放给我类似的结果。 There are 300 points recorded but only 4 of them will change my position on the emulator. 记录了300点,但是只有4点会改变我在模拟器上的位置。

Is there some kind of accuracy setting effecting the emulator? 是否有某种精度设置会影响模拟器? This way the load gpx track feature does not help a bit for testing. 这样,加载gpx跟踪功能对测试没有帮助。

Somebody else had strange issues with the load gpx file features? 有人在加载gpx文件功能时遇到了奇怪的问题?

Edit 编辑

This issue does not only affect the geo fix or load gpx file feature it affects all mock locations that are send to the emulator. 此问题不仅影响地理修复或加载gpx文件功能,还影响发送到模拟器的所有模拟位置。

Issue 11264 in the Android Bug tracking system states that there is a bug in the revision 0.9.8.v201008281755-53891 of the eclipse plugin or revision 7 of the android tools that leads to a truncation/rounding in the location after the second decimal place. Android Bug跟踪系统中的问题11264指出eclipse插件的版本0.9.8.v201008281755-53891或android工具的版本7中存在错误,导致第二个小数点后的位置被舍入/舍入。

I hope this bug will be fixed soon. 我希望这个错误会尽快修复。 If this bug causes you any inconveniences please star the issue in the android bug tracking system. 如果此错误给您带来不便,请在android bug跟踪系统中为该问题加注星标。

As a work around you can go back to an older eclipse plugin. 作为解决方法,您可以返回到较早的eclipse插件。 Version 0.9.6.v201002051504-24846 is working for me. 0.9.6.v201002051504-24846版本正在为我工​​作。 However reverting the eclipse plugin does not prevent the console to act weird for the geo commands, only the sending of coordinates through eclipse will get fixed. 但是,还原eclipse插件并不能防止控制台对geo命令产生奇怪的效果,只有通过eclipse发送坐标才能得到解决。

As far at the inaccuracy goes, a question I raised a while back regarding the emulator's behaviour: link text might shed some light on it. 到目前为止,关于准确性的问题,我提出了一个关于模拟器行为的问题: 链接文本可能会阐明一些问题。 The mapview will only receive location updates if you move position more than a minimum number of metres as specified by the 3rd parameter when you invoke the requestLocationUpdates(). 如果您在调用requestLocationUpdates()时将位置移动到第3个参数指定的最小米数以上,则mapview将仅接收位置更新。 Bear in mind that on a great circle(latitude changes) 0.001 degrees is about 108 metres. 请记住,在一个大圆上(纬度变化),0.001度约为108米。 For longitude changes it's 108m x cos(latitude). 经度更改为108m x cos(纬度)。

(If I send your coordinates of 52.038213000, 8.494062000 from the emulator control in DDMS in Eclipse, the map centres on 52.04200, 8.49688 (rounded to 6 dec places)) (如果我从Eclipse的DDMS中的仿真器控件发送了52.038213000、8.494062000的坐标,则地图将以52.04200、8.49688(四舍五入为12个小数位)为中心)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM