GPS on Emulator

walterf25

Expert
Licensed User
Longtime User
Hi guys, i was wondering, is there any code i need to add when using the gps library with the emulator, for some reason the emulator will not return any data when trying to find latitude and longitude values, if i test the code on my phone it does work, but it doesn't work with the emulator, i guess my question is, is there a way to get the gps working on the emulator.



Hope someone here can help me with this issue.

Thanks,
Walter
 

stevel05

Expert
Licensed User
Longtime User
I don't think the emulator provides GPS Data 'as is' but you can apparently access it using the DDMS utility provided with the Android SDK, it should be a batch file within the your android-sdk/tools folder.

Once connected it appears that you can set the location from there. I haven't tried it so can't guarantee it works, but worth a go.

EDIT: I have now tried it and it does indeed work, once the emulator and DDMS is running, select Emulator control and you have several options to set location information.

In addition, if you search Google for "Android Emulator GPS" some people have apparently written some utilities that allow clicking on a map to select and update the Emulator, these I haven't tried.
 
Last edited:
Upvote 0

warwound

Expert
Licensed User
Longtime User
I have MyFakeLocation installed on my emulators.

It displays a map which you can drag to set a location, that location is then detected by the emulator and your activity.

Martin.
 
Upvote 0
Top