In my app I do some expensive calculations that also include a http request based on the location. I'd like to improve the app by "detecting" if the user moved. Here are some thoughts:
1. every time I do the expensive part I save the location used for the calculation and the time
2. if more than 1 hour passed => recalculate
3. I'd like to be able to "cheaply" detect if the user "jumped" above a certain distance (let's say ~10k) and if yes => check actual distance from saved position and if > 10km => recalculate
4. I could check the actual position's distance from the saved position (let's say every 5 minutes), but it involves some floating point match calculations, so maybe there's a "cheaper" way to guess that the user "jumped"?
What I mean by jumped? For example:
- paused the activity recording, moved (maybe by car), then resumed
Not sure what I am looking for, probably some idea / trick others use. Maybe looking at speed/pace? Maybe there's some api I haven't noticed that could be used?