Fixing Geolocation for Android Emulator in Appcelerator Titanium

Published on Jul 10, 2012

I've been playing around with Appcelerator Titanium lately and one thing that I found frustrating was the fact that I couldn't get a GPS fix with the Android emulator. The iPhone emulator on the other hand was returning my current position just fine.

Of course, dummy data is being returned by the emulator. To make sure that the Android emulator returns a valid GPS location by using Geolocation in Titanium, you need to do the following:

1 - launch the Dalvik Debug Monitor a.k.a. ddms

The location of this tool depends on where you installed the Android SDK. For me, ddms is installed in /Users/jorre/Documents/SDKs/android-sdk-macosx/tools/ddms. Start the tool.

2 - select your Android emulator

Next, you will see a list of Android emulators that are running. For me, I was only running one instance that was called "titanium_". Click on the emulator on the left side of the ddms tool.

3 - send GPS/geolocation coordinates manually to the Android emulator

After selecting the Android emulator in the ddms tool, you will see a number of options on the right hand side of the ddms tool. The tab you are looking for is "emulator control". Scroll down until you see "Location Controls". Enter the latitude and longitude coordinates of your choice and click "Send". Android Emulator Geolocation Voila, you should now be able to do geolocation calls on your Android emulator. Hope that helps!

No comments? But that’s like a Gin & Tonic without the ice?

I’ve removed the comments but you can shoot me a message on LinkedIn to keep the conversation going.