我想在Android模拟器中获得经度和纬度进行测试。
有谁能指导我如何实现这个目标吗?
如何将模拟器的位置设置为测试位置?
我想在Android模拟器中获得经度和纬度进行测试。
有谁能指导我如何实现这个目标吗?
如何将模拟器的位置设置为测试位置?
当前回答
我试图通过adb为许多点设置地理定位,但无法让我的应用程序看到任何GPS数据。但当我尝试打开DDMS时,选择我的应用程序的进程并通过模拟器控制选项卡发送坐标,它马上就工作了。
其他回答
我试图通过adb为许多点设置地理定位,但无法让我的应用程序看到任何GPS数据。但当我尝试打开DDMS时,选择我的应用程序的进程并通过模拟器控制选项卡发送坐标,它马上就工作了。
我正在寻找一种更好的方法来设置模拟器的GPS坐标,而不是使用地理固定和手动确定特定的纬度和经度坐标。
找不到任何东西,我把一个小程序,使用GWT和谷歌Maps API来启动一个基于浏览器的地图工具,在模拟器中设置GPS位置:
android-gps-emulator
希望它能帮助那些无疑也会遇到这个困难/问题的人。
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.
Dalvik Debug Monitor >选择模拟器>模拟器控制选项卡>位置控制。
DDMS——android_sdk/tools/ DDMS或android_sdk/tools/monitor
如果上述解决方案不奏效。试试这个:
在你的android manifest .xml中,在应用程序标记之外添加以下两个链接,当然是在你的manifest标记中
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" ></uses-permission>
<uses-permission android:name="android.permission.INTERNET" ></uses-permission>