Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use network after a stay period #124

Closed
licaon-kter opened this issue Jan 12, 2020 · 3 comments
Closed

Don't use network after a stay period #124

licaon-kter opened this issue Jan 12, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@licaon-kter
Copy link
Contributor

Didn't know how to describe, so...

1.6 HEAD

I've setup 3s and 5m between updates

Everything is ok on the move, but I might stop in a bus stop or at a stop light, and then Hauk doesn't update....as expected.

But once I move again Hauk gets location from the network (I guess, the status says waiting for GNSS)....100m away.....or 1km away.

My proposition, after a stop period don't use network (or don't use if distance is >min distance set in settings)

Thoughts?

@bilde2910
Copy link
Owner

That's odd, but I can see which programming logic causes this to happen. There's no detectable difference between missing GNSS signal and lack of movement with the current implementation because it delegates the "minimum distance" part to Android itself, causing it to stop receiving updates. I can fix this by redelegating the minimum distance check to my own code instead. That should prevent the coarse location listener from being re-enabled if there's still signal, but no movement.

@bilde2910 bilde2910 added the bug Something isn't working label Jan 14, 2020
@bilde2910
Copy link
Owner

Sorry for the delay; I've been very busy with uni lately and haven't had time to work on Hauk.

This should resolve the issue. Instead of delegating the distance check to Android, I now do the distance check myself, keeping the GNSS location listener alive and just not submitting data until the distance is greater than the minimum set. If GNSS signal is lost, it should still fall back to network location.

I still don't know what causes the location updates to stop working even when you start moving again, but hopefully this will fix it.

@licaon-kter
Copy link
Contributor Author

I still don't know what causes the location updates to stop working even when you start moving again, but hopefully this will fix it.

Not sure it stops, maybe it stalls a bit...

So far I've fixed it by setting a really long timeout for stopped.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants