Mac 上的 Android 模拟器收到错误的纬度/经度

发布于 2024-09-28 18:20:34 字数 990 浏览 0 评论 0原文

好吧,这真的很奇怪。

我正在将纬度/经度发送到运行我的应用程序的模拟器,但它得到了错误的坐标!我发送的所有内容(通过 DDMS 使用 GPX 文件、DDMS 手册或 telnet 并使用 geo fix 命令)都会收到,但是当我打印应用程序收到的纬度/经度点时,有一点点偏差(好吧距离我的目标只有几百码)。

发现这一点是因为我一直在 PC 上测试我的应用程序,但最近购买了 Mac。因此,我正在进行标准测试,使用我一直在 PC 上使用的带有纬度/经度点的 GPX 文件,并且该应用程序显示了错误的位置。

例子: 我发送这个: 地理修复 地理修复 -72.74 41.74 在我的应用程序中, onLocationChanged, location.toString() 表示: 位置[mProvider=gps,mTime=1287892837000,mLatitude=41.74016776666667,mLongitude=-72.74533443333333,mHasAltitude=false,mAltitude=0.0,mHasSpeed=false,mSpeed=0.0,mHasBearing = false,mBearing = 0.0,mHasAccuracy = false,mAccuracy = 0.0,mExtras = Bundle [mParcelledData.dataSize = 4]]

我的意思是到底是什么?还使用 Google 地图进行了测试,如果我选择 myLocation,它会转到相同的古怪坐标,而不是我发送的实际坐标。

看起来像一些奇怪的数学或转换问题,因为数字很接近,但不准确。

同样,这一切在 PC 上运行良好, 这意味着,在 PC 上它会获取我发送的确切坐标。对于模拟器,我使用 AVD 管理器、WVGA854、Google API Level 8 创建了一个 avd。

在新的 MacBook pro、新的 Eclipse Helios 安装和新安装的 Android SDK 上运行。

Ok, this is a really weird one.

I'm sending Latitude/Longitude to Emulator running my App and its getting the wrong Coordinates !!! Everything I send (either via DDMS using GPX file, DDMS Manual, or telnet and using geo fix command), gets received, but when I print the latitude/longitude points received by the app, there are off by just a little bit (well a few hundred yards to where I was aiming for).

Discovered this because I've always tested my app on a PC, but recently purchased a Mac. So I'm going through my standard tests, using the GPX file with lat/long points that I always used on the PC, and the app is showing the wrong location.

Example:
I send this:
geo fix geo fix -72.74 41.74
And in my app, onLocationChanged, location.toString() says this:
Location[mProvider=gps,mTime=1287892837000,mLatitude=41.74016776666667,mLongitude=-72.74533443333333,mHasAltitude=false,mAltitude=0.0,mHasSpeed=false,mSpeed=0.0,mHasBearing=false,mBearing=0.0,mHasAccuracy=false,mAccuracy=0.0,mExtras=Bundle[mParcelledData.dataSize=4]]

I mean what the heck?? Tested with Google Maps also, and if I select myLocation, it goes to the same wacky coordinates instead of the actual ones I sent.

Looks like some weird math or conversion issue, since the numbers are close, but not exact.

Again, this all works fine on the PC, meaning, on the PC it gets the exact coordinates that I send. For the Emulator I created an avd using AVD manager, WVGA854, Google API Level 8.

Running on new MacBook pro, and new Eclipse Helios install and new install of Android SDK.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文