[racket] moby/phonegap/android: use acceleration or geolocation to derive velocity?

From: keydana at gmx.de (keydana at gmx.de)
Date: Tue Nov 2 13:52:44 EDT 2010


I am wondering how best to calculate velocity in a moby/phonegap/android application.
In general, would anyone have experience (or intuition) whether velocity might better be calculated from the acceleration values delivered by phonegap's Acceleration object, or directly be extracted from the Position object returned from Geolocation (it has a field 'velocity')?

Otherwise I'd plan to test and compare both ways, and for that, I'd have a technical question (most probably to Danny :-) ):
At the moment, the successCallback in the adapted phonegap.js receives the latitude and longitude only, whereas in the original (current) phonegap.js the complete Position object is returned. Is this intentional - I mean, does moby diverge from phonegap on purpose here (like experience showed the other fields are not reliable anyway, or not too much requested by users, or ...)? Or was this a modification to keep it simple at first, to be possibly extended later?
Also, what would be the way to adapt the racket side of it -  given on-location-change's contract,

(on-location-change world-updater) → handler
  world-updater : (world [latitude number] [longitude number] -> world)

would you make world-updater a variable arity function, or use case-lambda or keyword arguments to obtain the desired flexibility, or rather create and pass a 'position' object analogous to the javascript-side Position object?

BTW I noticed that in phonegap's (current) phonegap.js, there are no observers for orientation and shake... I'm just curious, was this functionality added during moby implementation (i.e., it never existed in phonegap's own phonegap.js), or it was removed in a newer phonegap release?

Many thanks in advance,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20101102/2361a7b1/attachment.html>

Posted on the users mailing list.