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?
If the above solutions don't work. Try this:
Inside your android Manifest.xml, add the following two links OUTSIDE of the application tag, but inside your manifest tag of course
For Android Studio users:
run the emulator,
Then, go to
Tools -> Android ->Android device monitor
open the
Emulator Control
Tab, and use the location controls group.Using the "geo" command in the emulator console
To send mock location data from the command line:
Launch your application in the Android emulator and open a terminal/console in your SDK's /tools directory.
Connect to the emulator console:
telnet localhost 5555
(Replace 5555 with whatever port your emulator is running on)Send the location data: * geo fix to send a fixed geo-location.
This command accepts a longitude and latitude in decimal degrees, and an optional altitude in meters. For example:
I use eclipse plug DDMS function to send GPS.
I was unable to get a GPS fix on the emulator when emulator was running Android image without Google APIs. As soon as I changed the image to contain Google APIs all of the here mentioned ways to get a GPS fix worked.
Make sure you select an image with Google APIs when creating AVD.
In eclipse:
You may have to drag the DDMS window down. 'Location Controls' is located under 'Telephony Actions' and may be hidden by a normally sized console view ( the bar with console, LogCat etc may be covering it!)
~