Home Delphi Get LocationSensor Speed on Android
Reply: 0

Delphi Get LocationSensor Speed on Android

user1864 Published in June 19, 2018, 7:51 pm

I'm currently developing a Localization Android App on Delphi / RADStudio Tokyo 10.2

I'm pretty new to delphi programming, and I am looking for a way to get the speed property of the LocationSensor. Through the documentation I found this:


But it always returns NaN, so I did some digging and found this in System.Sensors:

function TCustomLocationSensor.GetDoubleProperty(Prop: TProperty): Double;
  Result := NaN;

So I am confused, am I using the wrong property, or using it wrongly ? If so what should I use, or how should I use it?


My question differs from Xe5 locationsensor distance doesn't work? as I have no problem with GPS precision (or at least it doesn't seem so), allthough they might not be unrelated.The application communicates with a Server, that will display it's position and it's trajectory on a web browser.

For optimal usage, I have to transmit the travelling speed of the device. I thought of using Accelerometer at first, but it didn't fit the situation. Then I stumbled upon this on the embarcadero documentation : http://docwiki.embarcadero.com/Libraries/Tokyo/en/System.Sensors.TCustomLocationSensor.Speed

This was precisely what I needed, but when i try to get the value it always returns NaN, as explained above. Whilst debugging, I finally found the code showed above in System.Sensors and I thought it was strange that the function always returns NaN no matter what happens, as I found no help online ( just a few websites in japanese or russian http://www.360doc.com/content/17/0502/18/9200790_650383719.shtml http://www.cyberforum.ru/delphi-beginners/thread1386722.html) I posted here.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.398723 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO