Add minimum GPS accuracy preference for logging #670
Open
Andyporras wants to merge 3 commits intolabexp:developfrom
Open
Add minimum GPS accuracy preference for logging #670Andyporras wants to merge 3 commits intolabexp:developfrom
Andyporras wants to merge 3 commits intolabexp:developfrom
Conversation
Introduces a new user preference to set the minimum required GPS accuracy (in meters) before starting to record track points. Updates the GPSLogger service to respect this setting, waiting until the specified accuracy is achieved before logging locations. Adds relevant strings and preference UI elements.
jamescr
requested changes
Jan 26, 2026
Member
jamescr
left a comment
There was a problem hiding this comment.
Move preference keys and default values to OSMTracker. Preferences class. Check this commit for an example.
Min accuracy preference is numeric; consider using the setupEditTextNum() method from Preference Activity to force numeric inputs and add an option to reset to default value.
jamescr
reviewed
Jan 26, 2026
Introduced a new GPS minimum accuracy preference key and default value in OSMTracker. Updated Preferences activity to allow user configuration of minimum GPS accuracy. Refactored GPSLogger to use the new preference key and default, and removed the old constant from OpenStreetMapConstants.
Member
Author
|
Thanks @jamescr for the review. I've just refactored the code to move the constants to OSMTracker.Preferences and implemented setupEditTextNum() for the input field validation. Ready for another look! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a new user preference to set the minimum required GPS accuracy before starting to record track points. Updates the GPSLogger service to wait until the specified accuracy is achieved, and adds relevant UI strings and preference entry.
📝 Feat: Settings: minimum GPS accuracy to start recording track
🛠️ Issue
🛠️ Related issues (if applicable)
📖 Description
This PR introduces a new user preference to set the minimum required GPS accuracy before starting to record track points.
Changes:
Preferences UI: Added a new EditTextPreference in the GPS Settings menu (prefs_gps_min_accuracy) allowing users to input a value in meters (e.g., 10). Default is 0 (disabled).
Logic Implementation: Updated GPSLogger.java to read this preference.
Strings: Added necessary string resources for the new setting.
Rationale: This prevents the recording of widely inaccurate points (jumping) that often occur immediately after starting the GPS, significantly improving the quality of the track's start, especially for vertical distance computation.
🖼️ Screenshots (if applicable)
✅ Pull Request Checklist
📝 Additional Notes
The logic ensures that we only wait once at the beginning. If the GPS accuracy degrades later (e.g., entering a tunnel), the recording continues uninterrupted to avoid gaps in the track, satisfying the requirement to "wait before starting".