getodk / collect

ODK Collect is an Android app for filling out forms. It's been used to collect billions of data points in challenging environments around the world. Contribute and make the world a better place! ✨📋✨
https://docs.getodk.org/collect-intro
Other
715 stars 1.37k forks source link

"Warm" GPS for forms that will use it #5632

Open seadowg opened 1 year ago

seadowg commented 1 year ago

We currently provide some "hacky" solutions for making Collect start up location tracking at the beginning of a form, but we have the opportunity to improve on this by intentionally "warming" the GPS for any form that contains a question that might require a position (such as geopoint).

This has been discussed a few times on and off forum, but should now be fairly low cost to implement given the introduction of a general purpose background location tracking component (LocationTracker) and the ability to hook into JavaRosa's form parsing process (with XFormParser#addProcessor). With these changes, we should be able to start up the location tracking Foreground Service (showing a notification saying something like "Finding your location...") for forms with location question to give the device a chance to connect to satellites etc before the location questions themselves are reached (saving the enumerators seconds or even minutes).

seadowg commented 1 year ago

We should investigate the battery hit of doing this (for larger forms).