testing - GeoLocation App not working on Android Emulator -
i testing geo-location app using emulator created in android studio. have passed latitude , longitude using ddms seems work. confirmed going google , checking location. location changes based on changes on lat/long. however, app under test not getting location information. app displays location services not turned on when in fact turned on , working fine. there specific command can target app on emulator? have tried geo fix commands experiencing same issue.
this worked me once. best use actual device there no guarantee work everytime.
the android 2.x simulators not return geolocation result unless enablehighaccuracy option set true.
also use in code
navigator.geolocation.getcurrentposition(onsuccess, onerror, { maximumage: 2000, timeout: 10000, enablehighaccuracy: true });
and use telnet in emulator enter fixed co-ordinates
samvid@locahost:~$ telnet localhost 5554 trying 127.0.0.1... connected localhost.localdomain. escape character '^]'. android console: type 'help' list of commands ok geo fix 39.09091 27.44011 ok quit connection closed foreign host.
you can read more it here.
Comments
Post a Comment