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 you are using eclipse then using Emulator controller you can manually set latitude and longitude and run your map based app in emulator
I was trying to set the geo fix through adb for many points and could not get my app to see any GPS data. But when I tried opening DDMS, selecting my app's process and sending coordinates through the emulator control tab it worked right away.
See Obtaining User Location
Look under Providing Mock Location Data. You will find the solution for it.
No one here mentioned the built in solution of the emulator itself, so for future visitors, I'd like to share it with visuals.
First, run your Android Emulator and click on the menu button (3 dots) shown below:
Then from the left pane, select Location and change the coordinates according to your needs. After pressing Send button, changes will immediately take effect (I recommend you to open up Google Maps for better understanding).
Android Studio Version: 2.3.3
First go in DDMS section in your eclipse Than open emulator Control .... Go To Manual Section set lat and long and then press Send Button
If you're using
Eclipse
, go toWindow->Open Perspective->DDMS
, then type one inLocation Controls
and hitSend
.