Skip to first unread message
Assigned to halatmi...@gmail.com by steve....@gmail.com

Isaac Mercer

unread,
May 17, 2015, 12:09:06 AM5/17/15
to mitappinv...@googlegroups.com
I would like to calculate the device speed in kilometres per hour using appinventor. I know it can be done by dividing distance by time but with my previous experience this is very inaccurate and only works out an average which is practically useless. I have attached a test app I made which prints the speed. Is there some way I can modify this to provide a more accurate speed +-5km/h.

Thanks,
From Isaac
SpeedTest.aia

James Hancock

unread,
May 18, 2015, 1:02:59 AM5/18/15
to mitappinv...@googlegroups.com
yes, it's a problem, you can try to only use readings taken when the accuracy is high which is more common when moving but the real solution is to wait for appinventor to use the native speed value from the gps sensor. 

Isaac Mercer

unread,
May 18, 2015, 4:48:12 AM5/18/15
to mitappinv...@googlegroups.com
Yeah, I might have to do that but its probably not the optimal solution. Do we know why this feature is delayed and hasn't been implemented. It would probably be relatively easy to implement and would be very helpful, similar to the way altitude is presented.

SteveJG

unread,
May 18, 2015, 9:05:49 AM5/18/15
to mitappinv...@googlegroups.com
Yes, we do know why the feature is not available in the LocationSensor Isaac. Only a few features of GPS have been programmed.  Native speed along with the ability to read NEMA sentences and many of the features of a device GPS receiver certainly would be nice.

I agree this feature would be helpful however  when you say "It would probably be relatively easy to implement",  do you speak from Java coding experience?     App Inventor is OpenSource, and at the moment, no programmer has championed enhancements to the LocationSensor Control in AI.     The existing LocationSensor code is here  http://appinventor.mit.edu/appinventor-sources/  .   Take a look at the code.  If you are a Java programmer and you can add the feature, MIT would be glad to consider your proposal.   While you are at it, also please add NEMA sentences.    I can program Java, however I am not experienced enough in Java to do what is required.

John suggests waiting for MIT to add the Native Speed .... great idea, unfortunately, no one is working that issue at the moment.

Programming AI is relatively easy; rewriting the actual AI code and modifying components is difficult and time consuming.... just so you understand.    Help is appreciated. I sent a note to the great guy that programmed the LocationSensor mentioning your desires.  If he has time and other priorities permit, he will consider.  I vote for LS enhancements too. :)

As a note, you can do ALL of this using Android Studio...AS has an extensive geolocation Library, AI does not.

Regards,
Steve

SteveJG

unread,
May 18, 2015, 9:58:24 AM5/18/15
to mitappinv...@googlegroups.com
MIT is aware of the request for a LS upgrade.  MIT will see if any summer student is interested in a project regarding upgrading the LocationSensor  Students may have other priorities and interests and choose their own projects.  No promises anything will be worked on during the Summer regarding the LocationSensor, only that the question will be put to students.  Until then, Android Studio or create your own component :)  or provide you own work around code using AI.

Regards,
Steve

Thomas1980nl

unread,
May 19, 2015, 10:09:22 PM5/19/15
to mitappinv...@googlegroups.com
The ability to get the speed and track/course info directly from the GPS sensor would be very helpful to me as well! Thanks for considering..

Thomas
Reply all
Reply to author
Forward
0 new messages