Tuesday, February 03, 2009

 

Telling the android emulator where you are.

Once telneted into an emulator you can poke in a pair of map co-ordinates to give the impression the GPS unit has just got a fix.

Fun thing to remember is that the latitude and longitude are the wrong way round: you put the longitude first. Additionally use minus signs instead of chars, remembering North and East are positive.

So to fix a position like 55.623131N 11.997169 becomes 11.997169 55.623131


telnet localhost 5554
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying fe80::1...
telnet: connect to address fe80::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Android Console: type 'help' for a list of commands
OK
geo fix 11.997169 55.623131
OK

Note it uses proper decimal, such that 55° 35' 10" becomes 55.58611111.

For extra fun the geo command can even take a real nmea message

geo nmea $GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
OK

And if you tell the mapping application in the emulator to 'My Location', off the map will fly.

Labels:


Comments: Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]