I want to get longitude and latitude in Android emulator for testing.
Can any one guide me how to achieve this?
How do I set the location of the emulator to a test position?
I want to get longitude and latitude in Android emulator for testing.
Can any one guide me how to achieve this?
How do I set the location of the emulator to a test position?
For the new emulator:
http://developer.android.com/tools/devices/emulator.html#extended
Basically, click on the three dots button in the emulator controls (to the right of the emulator) and it will open up a menu which will allow you to control the emulator including location
Just make Alberto Gaona's answer into one line
5554 is the emulator port number shown in
adb devices
.It would have been better if
adb emu
work.Open Android studio->Tools menu->Android-> Android Device Monitor->Emulator Tab->Location control-> Set your required latitude and longitude and check your project as per your need
1. Android Studio users.
After running the emulator goto Tools->Android->Android device monitor
Click the Emulator Control Tab change from the location controls group.
2. Eclipse users.
First In Eclipse In Menu Select "Window" then Select "Open Perspective" then Select "DDMS". i.e Window->Open Prespective->DDMS.
You will see on Left Side Devices Panel and on Right Side you will see different tabs. Select "Emulator Control" Tab.
At bottom you will see Location Controls Panel. Select "Manual" Tab.
Enter Longitude and Latitude in Textboxs then Click Send Button. It will send the position to you emulator and the application.
3. Using telnet.
In the run command type this.
If you are not using windows you can use any telnet client.
After connecting with telnet use the following command to send your position to emulator.
4. Use the browser based Google maps tool
There is a program that uses GWT and the Google Maps API to launch a browser-based map tool to set the GPS location in the emulator:
android-gps-emulator
In Mac, Linux or Cygwin:
That will put you in Mexico City. Change your longitude/latitude/altitude accordingly. That should be enough if you are not interested in nmea.
For a project of my own, I developed an online service which can provide simulated location to the Android emulator.
It uses geo nmea rather than geo fix which allows it to set speed, course, precise time etc. in addition to just lat/lon.
The service requires the nc (netcat) command line utility and nothing else.
http://www.kisstech.ch/nmea/