Hi,

I've been playing around a bit with the sdk and the emulator today,
and have a question about Location.getSpeed()

I made a small app to test getting speed from the gps. It just prints
out the speed as it is received from the gps using a LocationListener
and Location.getSpeed()

The source code is here: http://pastebin.com/f75e6bfd0

To test it I used the "geo nmea XXX" command in the telnet console. I
made a small app that reads a nmea log I created earlier using gpsd
when doing a car trip, prepends "geo nmea " to each line and writes
them to port 5554 on localhost.

The problem is, the speed I get from getSpeed() isn't right, when
converting from m/s to km/h I get almost double the speed I really
did. Using the same nmea log with "gpsfake" and a linux app that uses
gpsd gives me the correct speed.

But if I treat the number I get from Location.getSpeed() as knots
instead of m/s i get the correct speed in km/h. I tried knots, since
many of the nmea sentences that return speed does so in knots.

So to me it seems that Location.GetSpeed actually returns the speed in
knots, not in m/s as is stated in the documentation. Is this correct,
or is there something else wrong? I've only tried this on the
emulator, not on an actual handset, since I don't own any phones that
run Android. So I dont know if a real handset acts differently from
the emulator. I'm using sdk 1.0 r2 on windows and eclipse with the
android plugin.

  --Vegard

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to