DDMS not able to send location to emulator

醉酒当歌 提交于 2019-12-01 02:37:31

问题


DDMS is not able to send location to the emulator. I have tried sending just the location from DDMS but still the emulator is not able to receive location. The application works properly in the device but its not able to capture location data in the emulator.

I am testing on Android 2.2 emulator. Can anyone let me know what can be the issue?


回答1:


I just use the android console via telnet, it always works.

Just open a command line and:

telnet localhost 5554

5554 is the port number of your emulator, it is usually that but might change, it can be on the window fram of the emulator as PORT:AVD_NAME.

You should be greeted with an Android console message.

To send positions to your device just type.

geo fix []

Two valid statements would be

geo fix -77.036519 38.896143
geo fix -77.036519 38.896143 100

Hope this helps, its not DDMS, but it works always. You can also feed it nmea sentences but I dont think you need that.




回答2:


Make sure your AVD has GPS support hardware set to true

Create New AVD > Hardware > New > GPS support

Value should be "yes"

Also, ensure your app is requesting location updates in some way, otherwise the emulator will just ignore any incoming locations from DDMS or the console.




回答3:


I don't know what your setup looks like, but I've had problems sending locations via DDMS using Windows XP and regional settings set to Swedish. Changing the regional settings to English(USA) solves the problem for me. I guess it has something to do with how numbers are formatted. With swedish settings numbers are formatted as 123 456 789,00 and with English(USA) as 123,456,789.00. Hope it helps




回答4:


I had this problem and I resolve it by disabling the firewall, hope it works for you.



来源:https://stackoverflow.com/questions/3656765/ddms-not-able-to-send-location-to-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!