Failed to simulate location data in Android emulator

I am trying to test my application that uses geolocation using an emulator. Several methods are described below. I will go to Window->Open Perspective->DDMS, then enter lat. and for a long time. one in Location Controls, and then I hit send.

enter image description here

But that will not work. Instead, I see the following error:Unable to send command to the emulator.

Why is this happening??

I do not think that my application is a problem because I tested it using the default browser of the emulator, and it also cannot access the location information.

Details:

  • OSX 10.9.4
  • AVD_for_Nexus_4_by_Google targeting v4.4.2
  • Eclipse IDE for Android Developers 23.0.2.1259578

Update: AVD_for_Galaxy_Nexus_by_Google, , . "", .

Update2: Telnet , . . . Urgh!

telnet localhost 5554
geo fix 50 50

OK, . - .

Update3: LogCat

09-20 17:58:59.910: E/eglCodecCommon(1777): glUtilsParamSize: unknow param 0x00000b44
09-20 17:58:59.910: E/eglCodecCommon(1777): glUtilsParamSize: unknow param 0x00000bd0
09-20 17:58:59.930: E/eglCodecCommon(1777): **** ERROR unknown type 0x0 (glSizeof,72)

, .

4: , , AVD GPS-, / . " Android" "" , , : enter image description here

" GPS".

5: config.ini AVD, hw.gps=yes. AVD Google API, . , , " ", telnet.

6: Gyebro ... LocationDemo... enter image description here

LogCat:

+4
6

, GPS, ~/.android/avd/<emulatorname>.avd/ config.ini hardware-qemu.ini ( ), :

hw.gps = yes


Google API. Google APIs - API Level 1#

f8fX6.png EDIT

, , , : LocationTest, . Dev docs

GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener LocationListener. Google Play LocationClient ( Google Emulator.) (. MainActivity.java)

. , GP , LocationClient .

y0jd3.png

 D/LocationTest﹕ Google Play services is available.
 D/LocationTest﹕ LocationClient: Connected

geo fix 66 80 telnet ( OK) DDMS, :

w2JLV.png

 D/LocationTest﹕ Location changed!

, - Mock Location Provider.

+5

GENYMOTION, GPS, , , , , GPS "GPS-". .

genymotino gps widget

+2

SDK adb, Google - (maps.google.com). adb, telnet . , .avd hw.gps=yes ( ). Google API. - , .. opengl logcat, , .

google maps Android, . , . , , . .. zip LocationProvider, .

:

  • Android
  • ,
  • genymotion, genyshell, genymotion

    genyshell.exe -c "gps setstatus enabled" genyshell.exe -c "gps setlatitude 30.3077609" genyshell.exe -c "gps setlongitude -97.7534014"

.

Update: - LocationTest gyebro, , telnet. , , , Google , adb. location test demo

+1

Genymotion? , USB, GPS . , AVD, AVD, , Android .

, .

+1

. , AVD DDMS .

LAT: -16,691534 LNG: -49,266185 - , !

0

, AVD GPS, true

AVD > > > GPS

""

, , - , DDMS .

()

Android telnet, .

:

telnet localhost 5554

5554 - the port number of your emulator, this can usually change, it can be in the emulator frame window as PORT: AVD_NAME.

You should welcome the message from the Android console.

To send line items to a device, simply enter.

geo fix []

Two valid operators:

geo fix -77.036519 38.896143
geo fix -77.036519 38.896143 100

Hope this helps, this is not DDMS, but it always works. You can also submit nmea suggestions, but I don’t think you need it.

-1
source

All Articles