我想在Android模拟器中获得经度和纬度进行测试。

有谁能指导我如何实现这个目标吗?

如何将模拟器的位置设置为测试位置?


当前回答

首先进入eclipse中的DDMS部分 比打开模拟器控件.... 转到手动部分 设置纬度和长度,然后按发送按钮

其他回答

请参见获取用户位置

请参阅提供模拟位置数据。你会找到解决方法的。

The already mentioned multiple times answer to use the shell command "geo fix..." is the correct answer. But in case you use LocationClient.getLastLocation() to retrieve your data it is worth to mention that it will not work at first. The LocationClient class uses the Google Play Service to retrieve the coordinates. For me this started working after running the emulators maps app once. During the first start you are asked to allow google apps access to your location, which I guess does the trick.

你可以使用像genymotion这样的模拟器,它可以让你灵活地模拟当前的GPS位置等。

Dalvik Debug Monitor >选择模拟器>模拟器控制选项卡>位置控制。

DDMS——android_sdk/tools/ DDMS或android_sdk/tools/monitor

对于BlueStack用户:打开模拟器,按Ctrl+Shift +K,然后找到你的位置,并按下设置位置!