Page 1 of 1
Please add Speed property to GPS
Posted: Sun Mar 25, 2012 11:13 pm
by BarrySumpter
I've been using the GPS from Basic4Android.
It has a speed property.
Could we please add a speed property to the LiveCode GPS?
Many thanks
Re: Please add Speed property to GPS
Posted: Wed Apr 04, 2012 3:02 am
by BarrySumpter
Does anyone know if the Acceleration from mobileSensorReading can be used as speed?
Re: Please add Speed property to GPS
Posted: Tue Apr 24, 2012 3:16 pm
by mtimmerm
This seems not possible. Becuase this is not detecting a constant movement. We need this one:
https://developer.apple.com/library/ios ... tion/speed
But I am affraid they forgot to implement this in LC

. I am not finding this anywhere!
Marcel
Re: Please add Speed property to GPS
Posted: Tue Apr 24, 2012 9:19 pm
by BarrySumpter
Yes, I am finding LC4A got the short end of the stick again.
Always, gotta leave something for the next release.
So can't have LC4iOS and LC4A at the same level.
Always leave em wanting more.
I have no doubt that no matter what the updates and enhancements I'll find the next limitation.
If we could just enhance LiveCode ourselves like b4a, Java and C++ developers can.
So much easier deving in LiveCode.
I prefer to dev in LiveCode so will always find its limitation first.
Then decide what to do next.
A work around or not so eligant solution.
Re: Please add Speed property to GPS
Posted: Wed Apr 25, 2012 1:35 pm
by mtimmerm
Hi,
I couldn't agree more. I am using the latest version of LC and it is not there and also background running is not included. I am a little bit frustrated

becuase they told me when I purchase this I could do the same as in XCOde and if not I could use externals. But this is not the case with background running. And speed?? Really, this should already be included way back.
If you find a work arround please let me know! I will do the same!
Re: Please add Speed property to GPS
Posted: Fri May 04, 2012 2:34 pm
by seaniepie
You need to write an external (using the external SDK) that can implement the CLLocation. In Android there are no external SDKs yet. If you wanna fund RR some more maybe, with the extra resources, they can get done sooner.
Re: Please add Speed property to GPS
Posted: Mon Apr 20, 2020 10:22 pm
by mtalluto
This is possible now. I do not know which version of LC getting the speed was released.
Sample code:
on openCard
if the platform is "iphone" then
mobileStartTrackingSensor "location", false
end if
end openCard
command locationChanged
local tSensorDataA, tSpeed
--RETURN A STRING WITH THE CURRENT LATITUDE, LONGITUDE AND ALTITUDE
put mobileSensorReading("location",true) into tSensorDataA
if tSensorDataA is empty then
put "No data" into fld "speed"
exit locationChanged
end if
put tSensorDataA["speed"] into tSpeed --output is in meters per second
if tSpeed is empty or tSpeed = "0.0" then
set numberFormat to "x"
put 0 into tSpeed
put "0" into fld "speed"
exit locationChanged
else
set numberFormat to "x.x"
end if
put tSpeed * 2.237 into tSpeed --convert meters per second to miles per hour
if tSpeed > sMaxSpeed then put tSpeed into sMaxSpeed
put "Max speed:" && max(tSpeed,sMaxSpeed) into fld "max speed"
put tSpeed into fld "speed"
end locationChanged
Re: Please add Speed property to GPS
Posted: Sun Jun 01, 2025 9:12 am
by richmond62
That last posting smells like hot sauce.