Skip to content

Record first point when starting automatic recording#7045

Merged
grzesiek2010 merged 3 commits intogetodk:masterfrom
seadowg:first-point
Jan 23, 2026
Merged

Record first point when starting automatic recording#7045
grzesiek2010 merged 3 commits intogetodk:masterfrom
seadowg:first-point

Conversation

@seadowg
Copy link
Member

@seadowg seadowg commented Jan 22, 2026

Closes #7041
Blocked by #7043

Why is this the best possible solution? Were any other approaches considered?

Comments inline.

One note: I've avoided adding tests for the fix as I'll plan to follow up with changes to the LocationTracker detailed at #7045 (comment) and add tests for the more ideal setup there.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Should just fix the issue! Not a large change here - does not need tested with different map engines.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

override fun startInput() {
inputActive = true
if (recordingEnabled && recordingAutomatic) {
locationTracker.warm(map!!.getGpsLocation()?.toLocation())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd initially thought about entirely replacing the use of the MapFragment GPS integration with LocationTracker in GeoPolyFragment. To do that there are a few things we'd need to add to LocationTracker:

  1. It would need to be pausable to prevent background GPS system usage when not using automatic recording
  2. We'd need to be able to speed up/slow down the update interval to adapt to different automatic recording intervals
  3. There'd ideally be a smart way to switch between running as a background and foreground service: if the service can be paused, there's no need for it to be running as a foreground service all the time

For the moment, I think adding a way to "warm" the LocationTracker and deprecating the MapFragment GPS methods (so that it's clear we want to move away from them) gets us parity with the last release without take time away from further invalid polygon work.

@seadowg seadowg marked this pull request as ready for review January 23, 2026 10:10
@seadowg seadowg requested a review from grzesiek2010 January 23, 2026 10:10
@grzesiek2010 grzesiek2010 merged commit 57f20b4 into getodk:master Jan 23, 2026
7 checks passed
@seadowg seadowg deleted the first-point branch January 26, 2026 09:12
@dbemke
Copy link

dbemke commented Jan 28, 2026

Tested with Success!

Verified on devices with Android 10

Verified cases:

@WKobus
Copy link

WKobus commented Jan 28, 2026

Tested with success

Verified on Android 16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatic location recording in geoshape/trace seems slower on some devices

4 participants