Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emulator's Location simulation not working

I would like to lower the minimum API level of my application to 4.4(KitKat) from 5.0(Lollipop)

Sadly I couldn't get any real devices so I have to work with an emulator.

My app is heavily based on user's location so the main testing must be target the location changing feature.

I try to use location simulation with the official Google Android Emulator. (x86)

I have made a 4.4 Emulator and is working fine, my app works fine but when I try to send locations via the Extended control panel nothing happens.

If I load a GPX file the locations appear on the table of the extended control panel inside the GPS data playback but the device does not get any locations.

enter image description here

I fill the lat and longitude click on "SEND" but nothing happens.

I have also tried to simulate location changing from the Android Device Monitor's "Emulator Control" tab

The "Send" button is not clickable at all, the long and lat fields are disabled and I cannot fill anything. The "GPX" and "KML" tabs are also disabled.

enter image description here

I have also tried to use the Gps Emulator plugin as the following:

enter image description here

The progress bar do increases, so not like the first 2 methods I have tried this is finally looks like actually doing something but the emulator still not getting the location changes. Not at all.

I have tried a fourth method via command line:

telnet localhost 5554 

But I have Connection refused error message.

So I cannot try to send locations via:

geo fix <longitude value> <latitude value> 

(Telnet is enabled on my Windows)

like image 591
Adam Varhegyi Avatar asked Jul 07 '16 13:07

Adam Varhegyi


People also ask

How do I get current location on emulator?

From terminal run telnet localhost 5554 , you are now in emulator shell. Type help ,it will show available commands , like faking a call, sms, battery etc. To know more about a command type help <command name> . Type help geo , it will print available location commands.


1 Answers

I had the same problem, but I managed to fix it.

Run Google Maps and accept confirmations at least once until you see the map. Do not forget to set your location setting to ON/High accuracy, as shown in the screenshot below.

Google Maps Settings

like image 62
Emre Kilinc Arslan Avatar answered Oct 20 '22 22:10

Emre Kilinc Arslan