Android Emulator - PhoneGap GPS Location?

萝らか妹 提交于 2019-12-12 13:27:50

问题


I'm playing around with Phone Gap and an Android Emulator. Is there away to test the GPS within the emulator? Obviously the emulator doesn't have a GPS, but is there a debug mode or something?

Every time I test it, the GPS 'onDeviceReady' just goes straight to the 'onError' function.

A way around this?

Thanks.


回答1:


Within Android emulator, you could try using ddms.

developer.android.com/tools/debugging/ddms.html


For debugging phonegap application outside the emulator, PhoneGap Emulation / Ripple allow you to test in desktop browser.

http://emulate.phonegap.com/ "PhoneGap Emulation powered by Ripple"

Click the setting gears and check "Override Geolocation".


Weinre (WEb INspector REmote) enables you to test the web application remotely.

debug.phonegap.com/

people.apache.org/~pmuellr/weinre/docs/latest/




回答2:


If you using Eclipse you can go to "window->open pespective->ddms". Then you go to Emulator Control tab. There is a "Location Control" and you can send a location.



来源:https://stackoverflow.com/questions/15665684/android-emulator-phonegap-gps-location

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