Help LocationSensor

i am using LocationSensor for my application, however I am wondering if the :TimeInterval and DistanceInterval parameters have any effect on the accuracy of the LocationSensor. And how often are these 2 parameters set?

Good day Phước.

I don't think TimeInterval has anything to do with the accuracy of the LocationSensor, because it has more to do with the refresh rate of the sensor. If your phone stays at one location for a long time, TimeInterval does not really matter. However, if you are moving around, let's say, in an app recording the journey of a car, you would want a small TimeInterval smaller than 60K ms.

By taking a look at the documentation, there is an Accuracy block in the component that helps you to retrieve the accuracy. It is not available in the Designer, and not writable.

Determines the minimum time interval, in milliseconds, that the sensor will try to use for sending out location updates. However, location updates will only be received when the location of the phone actually changes, and use of the specified time interval is not guaranteed. For example, if 30000 is used as the time interval, location updates will never be fired sooner than 30000ms, but they may be fired anytime after.

You can have a device that sends the location very fast, but inaccurate; vice versa, you can have a device that sends the location a little bit slower, but accurate. I do not believe accuracy matters, however there is a note in the documentation as well.

Values smaller than 30000ms (30 seconds) are not practical for most devices. Small values may drain battery and overwork the GPS.

For your second query about what the TimeInterval is usually set to, I did some research and found Steve's social distancing tutorial.

Certainly, thirty seconds is more frequent location polling than necessary for most usage but the value works great for testing purposes.

From the documentation and the advice from Steve, I think 30 seconds (30000 ms) should be fine.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.