From bd3569890b80216f34e9706950956fa536a57e41 Mon Sep 17 00:00:00 2001 From: Andy Porras Date: Sun, 25 Jan 2026 00:05:11 -0600 Subject: [PATCH 1/3] Add minimum GPS accuracy preference for logging 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. --- .../osm/OpenStreetMapConstants.java | 1 + .../net/osmtracker/service/gps/GPSLogger.java | 37 ++++++++++++++++++- .../main/res/values/strings-preferences.xml | 4 ++ app/src/main/res/xml/preferences.xml | 8 ++++ 4 files changed, 49 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/osmtracker/osm/OpenStreetMapConstants.java b/app/src/main/java/net/osmtracker/osm/OpenStreetMapConstants.java index f51469320..b8e052315 100644 --- a/app/src/main/java/net/osmtracker/osm/OpenStreetMapConstants.java +++ b/app/src/main/java/net/osmtracker/osm/OpenStreetMapConstants.java @@ -6,6 +6,7 @@ public class OpenStreetMapConstants { private static final String OSM_API_URL_DEV = "https://master.apis.dev.openstreetmap.org"; private static final String OSM_API_URL_PROD = "https://www.openstreetmap.org"; private static final String OSM_API_URL = (DEV_MODE) ? OSM_API_URL_DEV : OSM_API_URL_PROD; + public static final String PREFS_GPS_MIN_ACCURACY = "gps_min_accuracy"; public static class Api { diff --git a/app/src/main/java/net/osmtracker/service/gps/GPSLogger.java b/app/src/main/java/net/osmtracker/service/gps/GPSLogger.java index fb785d279..35dd73dd6 100644 --- a/app/src/main/java/net/osmtracker/service/gps/GPSLogger.java +++ b/app/src/main/java/net/osmtracker/service/gps/GPSLogger.java @@ -10,6 +10,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.location.Location; import android.location.LocationListener; @@ -31,6 +32,7 @@ import net.osmtracker.db.TrackContentProvider; import net.osmtracker.listener.PressureListener; import net.osmtracker.listener.SensorListener; +import net.osmtracker.osm.OpenStreetMapConstants; /** * GPS logging service. @@ -56,6 +58,14 @@ public class GPSLogger extends Service implements LocationListener { * Is GPS enabled ? */ private boolean isGpsEnabled = false; + /** + * Minimum accuracy in meters for starting + */ + private int minAccuracy = 0; + /** + * Precision of the accuracy in meters is satisfied ? + */ + private boolean isAccuracySatisfied = false; /** * Use barometer yes/no ? @@ -223,6 +233,18 @@ public void onCreate() { use_barometer = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext()).getBoolean( OSMTracker.Preferences.KEY_USE_BAROMETER, OSMTracker.Preferences.VAL_USE_BAROMETER); + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext()); + try { + minAccuracy = Integer.parseInt(prefs.getString(OpenStreetMapConstants.PREFS_GPS_MIN_ACCURACY, "0")); + } catch (NumberFormatException e) { + minAccuracy = 0; + } + // minimum precision enabled + if (minAccuracy > 0) { + isAccuracySatisfied = false; + } else { + isAccuracySatisfied = true; + } // Register our broadcast receiver IntentFilter filter = new IntentFilter(); filter.addAction(OSMTracker.INTENT_TRACK_WP); @@ -307,7 +329,20 @@ private void stopTrackingAndSave() { } @Override - public void onLocationChanged(Location location) { + public void onLocationChanged(Location location) { + if (location == null){ + return; + } + // Wait for minimum accuracy before starting + if(!isAccuracySatisfied){ + if(location.hasAccuracy() && location.getAccuracy() <= minAccuracy){ + // Precision achieved we unlocked the door and began recording this one and the following ones. + isAccuracySatisfied = true; + } + else { + return; + } + } // We're receiving location, so GPS is enabled isGpsEnabled = true; diff --git a/app/src/main/res/values/strings-preferences.xml b/app/src/main/res/values/strings-preferences.xml index 828793888..748ce2a69 100644 --- a/app/src/main/res/values/strings-preferences.xml +++ b/app/src/main/res/values/strings-preferences.xml @@ -26,6 +26,10 @@ Min. distance between track points in meters, use 0 for the shortest possible meters + GPS minimum accuracy + Wait until accuracy is better than this value (in meters) to start recording. 0 to disable. + Enter minimum accuracy (meters) + User interface Default photo source diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index dc1749d09..2aa475c29 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -51,6 +51,14 @@ android:summary="@string/prefs_gps_logging_min_distance_summary" android:defaultValue="0" android:inputType="number" /> + From 184e180377d095b16f81719f7079bada66bcab28 Mon Sep 17 00:00:00 2001 From: Andy Porras Date: Mon, 26 Jan 2026 22:29:36 -0600 Subject: [PATCH 2/3] Add GPS minimum accuracy preference and refactor usage 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. --- .../main/java/net/osmtracker/OSMTracker.java | 2 ++ .../net/osmtracker/activity/Preferences.java | 9 +++++++++ .../osm/OpenStreetMapConstants.java | 1 - .../net/osmtracker/service/gps/GPSLogger.java | 19 ++++++++++--------- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/net/osmtracker/OSMTracker.java b/app/src/main/java/net/osmtracker/OSMTracker.java index 3accb77c9..4c4e942a6 100644 --- a/app/src/main/java/net/osmtracker/OSMTracker.java +++ b/app/src/main/java/net/osmtracker/OSMTracker.java @@ -23,6 +23,8 @@ public static final class Preferences { public final static String KEY_GPS_IGNORE_CLOCK = "gps.ignoreclock"; public final static String KEY_GPS_LOGGING_INTERVAL = "gps.logging.interval"; public final static String KEY_GPS_LOGGING_MIN_DISTANCE = "gps.logging.min_distance"; + public static final String KEY_GPS_MIN_ACCURACY = "gps_min_accuracy"; + public static final String VAL_GPS_MIN_ACCURACY = "0"; public final static String KEY_USE_BAROMETER = "gpx.use_barometer"; public final static String KEY_USE_NOTES = "gpx.notes"; public final static String KEY_OUTPUT_FILENAME = "gpx.filename"; diff --git a/app/src/main/java/net/osmtracker/activity/Preferences.java b/app/src/main/java/net/osmtracker/activity/Preferences.java index 9e637d2ab..61e79fc15 100644 --- a/app/src/main/java/net/osmtracker/activity/Preferences.java +++ b/app/src/main/java/net/osmtracker/activity/Preferences.java @@ -90,6 +90,15 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { getString(R.string.prefs_gps_logging_min_distance_empty), OSMTracker.Preferences.VAL_GPS_LOGGING_MIN_DISTANCE ); + // GPS Minimum Accuracy + setupEditTextNum( + OSMTracker.Preferences.KEY_GPS_MIN_ACCURACY, + getString(R.string.prefs_gps_logging_min_distance_meters), + getString(R.string.prefs_gps_min_accuracy_summary), + getString(R.string.prefs_gps_logging_interval_empty), + OSMTracker.Preferences.VAL_GPS_MIN_ACCURACY + ); + // GPX Settings diff --git a/app/src/main/java/net/osmtracker/osm/OpenStreetMapConstants.java b/app/src/main/java/net/osmtracker/osm/OpenStreetMapConstants.java index fdedb95ce..a7610be46 100644 --- a/app/src/main/java/net/osmtracker/osm/OpenStreetMapConstants.java +++ b/app/src/main/java/net/osmtracker/osm/OpenStreetMapConstants.java @@ -6,7 +6,6 @@ public class OpenStreetMapConstants { private static final String OSM_API_URL_DEV = "https://master.apis.dev.openstreetmap.org"; private static final String OSM_API_URL_PROD = "https://www.openstreetmap.org"; private static final String OSM_API_URL = (DEV_MODE) ? OSM_API_URL_DEV : OSM_API_URL_PROD; - public static final String PREFS_GPS_MIN_ACCURACY = "gps_min_accuracy"; public static class Api { diff --git a/app/src/main/java/net/osmtracker/service/gps/GPSLogger.java b/app/src/main/java/net/osmtracker/service/gps/GPSLogger.java index d4cf752a3..168dda5ed 100644 --- a/app/src/main/java/net/osmtracker/service/gps/GPSLogger.java +++ b/app/src/main/java/net/osmtracker/service/gps/GPSLogger.java @@ -260,16 +260,17 @@ public void onCreate() { use_barometer = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext()).getBoolean( OSMTracker.Preferences.KEY_USE_BAROMETER, OSMTracker.Preferences.VAL_USE_BAROMETER); - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext()); - try { - minAccuracy = Integer.parseInt(prefs.getString(OpenStreetMapConstants.PREFS_GPS_MIN_ACCURACY, "0")); - } catch (NumberFormatException e) { - minAccuracy = 0; - } + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext()); + + try { + minAccuracy = Integer.parseInt(prefs.getString( + OSMTracker.Preferences.KEY_GPS_MIN_ACCURACY, + OSMTracker.Preferences.VAL_GPS_MIN_ACCURACY)); + } catch (NumberFormatException e) { + minAccuracy = Integer.parseInt(OSMTracker.Preferences.VAL_GPS_MIN_ACCURACY); + } // minimum precision enabled - if (minAccuracy > 0) { - isAccuracySatisfied = false; - } else { + if (minAccuracy == 0) { isAccuracySatisfied = true; } // Register our broadcast receiver From 70f5362446ab282327d6e8c50e1b2fc67898c95c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Guti=C3=A9rrez=20Alfaro?= <593829+jamescr@users.noreply.github.com> Date: Sun, 22 Feb 2026 21:37:33 -0600 Subject: [PATCH 3/3] Review of PR670 (#4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Feature: Show note count in tracks list * Feature: Add a What's New slide to the App intro. * [Transifex] Updates for project OSMTracker for Android™ * [Transifex] Updates for project OSMTracker for Android™ (#679) * Translate strings.xml in el 82% of minimum 80% translated source file: 'strings.xml' on 'el'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * Translate strings.xml in sk 82% of minimum 80% translated source file: 'strings.xml' on 'sk'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * Translate strings.xml in pl 91% of minimum 80% translated source file: 'strings.xml' on 'pl'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * Translate strings.xml in es 99% of minimum 80% translated source file: 'strings.xml' on 'es'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * Translate strings.xml in zh_TW 99% of minimum 80% translated source file: 'strings.xml' on 'zh_TW'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * Translate strings.xml in pt_BR 99% of minimum 80% translated source file: 'strings.xml' on 'pt_BR'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * Translate strings.xml in sv 93% of minimum 80% translated source file: 'strings.xml' on 'sv'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * Translate strings.xml in nl 93% of minimum 80% translated source file: 'strings.xml' on 'nl'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * Translate strings.xml in ru 93% of minimum 80% translated source file: 'strings.xml' on 'ru'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * Translate strings.xml in es 100% translated source file: 'strings.xml' on 'es'. * Translate strings.xml in pt_BR 100% translated source file: 'strings.xml' on 'pt_BR'. * Translate strings.xml in zh_TW 100% translated source file: 'strings.xml' on 'zh_TW'. --------- Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com> * Increases version number to 72 * Fix: Add fallback when pref value is not set * Translate strings-preferences.xml in es 100% translated source file: 'strings-preferences.xml' on 'es'. * Translate strings-preferences.xml in pt_BR 100% translated source file: 'strings-preferences.xml' on 'pt_BR'. * Translate strings-preferences.xml in zh_TW 98% of minimum 80% translated source file: 'strings-preferences.xml' on 'zh_TW'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * Increase version code to 73 * Increase version code to 74 * Translate strings-preferences.xml in zh_TW 100% translated source file: 'strings-preferences.xml' on 'zh_TW'. * Add minimum GPS accuracy preference for logging 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. # Conflicts: # app/src/main/res/values/strings-preferences.xml # app/src/main/res/xml/preferences.xml * Add GPS minimum accuracy preference and refactor usage 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. * Refactor and review of PR670 --------- Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com> Co-authored-by: Andy Porras --- app/build.gradle | 3 +- .../main/java/net/osmtracker/OSMTracker.java | 4 +-- .../java/net/osmtracker/activity/Intro.kt | 29 +++++++++++++++++-- .../net/osmtracker/activity/Preferences.java | 26 ++++++++++------- .../activity/TrackListRVAdapter.java | 2 ++ .../net/osmtracker/db/TracklistAdapter.java | 4 ++- .../net/osmtracker/service/gps/GPSLogger.java | 13 ++++++++- app/src/main/res/layout/tracklist_item.xml | 25 ++++++++++++++++ app/src/main/res/values-el/strings.xml | 1 + .../res/values-es/strings-preferences.xml | 8 +++++ app/src/main/res/values-es/strings.xml | 16 ++++++++++ app/src/main/res/values-nl/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + .../res/values-pt-rBR/strings-preferences.xml | 20 +++++++++++++ app/src/main/res/values-pt-rBR/strings.xml | 16 ++++++++++ app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + .../res/values-zh-rTW/strings-preferences.xml | 2 +- app/src/main/res/values-zh-rTW/strings.xml | 3 ++ .../main/res/values/strings-preferences.xml | 3 +- app/src/main/res/values/strings.xml | 3 ++ app/src/main/res/xml/preferences.xml | 13 ++++----- 23 files changed, 169 insertions(+), 27 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a7b6d9f61..b59388fe0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,7 +15,7 @@ android { multiDexEnabled true // Version code should be increased after each release - versionCode 71 + versionCode 74 versionName new Date().format('yyyy.MM.dd') testApplicationId "net.osmtracker.test" @@ -104,6 +104,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.7.0' implementation 'androidx.preference:preference:1.2.0' + implementation 'androidx.preference:preference-ktx:1.2.1' // Required -- JUnit 4 framework testImplementation 'junit:junit:4.13.2' diff --git a/app/src/main/java/net/osmtracker/OSMTracker.java b/app/src/main/java/net/osmtracker/OSMTracker.java index 4c4e942a6..5d5f94d09 100644 --- a/app/src/main/java/net/osmtracker/OSMTracker.java +++ b/app/src/main/java/net/osmtracker/OSMTracker.java @@ -23,8 +23,7 @@ public static final class Preferences { public final static String KEY_GPS_IGNORE_CLOCK = "gps.ignoreclock"; public final static String KEY_GPS_LOGGING_INTERVAL = "gps.logging.interval"; public final static String KEY_GPS_LOGGING_MIN_DISTANCE = "gps.logging.min_distance"; - public static final String KEY_GPS_MIN_ACCURACY = "gps_min_accuracy"; - public static final String VAL_GPS_MIN_ACCURACY = "0"; + public static final String KEY_GPS_LOGGING_MIN_ACCURACY = "gps.logging.min.accuracy"; public final static String KEY_USE_BAROMETER = "gpx.use_barometer"; public final static String KEY_USE_NOTES = "gpx.notes"; public final static String KEY_OUTPUT_FILENAME = "gpx.filename"; @@ -63,6 +62,7 @@ public static final class Preferences { public final static boolean VAL_GPS_IGNORE_CLOCK = false; public final static String VAL_GPS_LOGGING_INTERVAL = "0"; public final static String VAL_GPS_LOGGING_MIN_DISTANCE = "0"; + public static final String VAL_GPS_LOGGING_MIN_ACCURACY = "0"; public final static boolean VAL_USE_BAROMETER = false; public final static String VAL_USE_NOTES = "both"; diff --git a/app/src/main/java/net/osmtracker/activity/Intro.kt b/app/src/main/java/net/osmtracker/activity/Intro.kt index 2b204f770..ff272334a 100644 --- a/app/src/main/java/net/osmtracker/activity/Intro.kt +++ b/app/src/main/java/net/osmtracker/activity/Intro.kt @@ -1,6 +1,8 @@ package net.osmtracker.activity import android.os.Bundle +import androidx.activity.enableEdgeToEdge +import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import androidx.preference.PreferenceManager import com.github.appintro.AppIntro @@ -11,9 +13,24 @@ import androidx.core.content.edit class Intro : AppIntro() { override fun onCreate(savedInstanceState: Bundle?) { + // Enable Edge-to-Edge support. Must be called before super.onCreate() + enableEdgeToEdge() super.onCreate(savedInstanceState) // Make sure you don't call setContentView! + // Set the colors for the bottom bar elements + val activeColor = ContextCompat.getColor(this, R.color.colorAccent) + val inactiveColor = ContextCompat.getColor(this, R.color.colorPrimary) + + setIndicatorColor( + selectedIndicatorColor = activeColor, + unselectedIndicatorColor = inactiveColor + ) + + setColorDoneText(activeColor) + setColorSkipButton(activeColor) + setNextArrowColor(activeColor) + // Call addSlide passing your Fragments. // You can use AppIntroFragment to use a pre-built fragment addSlide(AppIntroFragment.createInstance( @@ -23,6 +40,14 @@ class Intro : AppIntro() { description = getString(R.string.app_intro_slide1_description) )) + // Whats new Fragment + addSlide(AppIntroFragment.createInstance( + title = getString(R.string.app_intro_slide_whats_new_title), + imageDrawable = R.drawable.icon_100x100, + backgroundColorRes = R.color.appintro_background_color, + description = getString(R.string.app_intro_slide_whats_new_description) + )) + //TODO: change the image of slide number 2. addSlide(AppIntroFragment.createInstance( title = getString(R.string.app_intro_slide2_title), @@ -40,8 +65,8 @@ class Intro : AppIntro() { override fun onDonePressed(currentFragment: Fragment?) { super.onDonePressed(currentFragment) - // Decide what to do when the user clicks on "Done" - PreferenceManager.getDefaultSharedPreferences(baseContext).edit { + // Use the KTX extension for cleaner SharedPreferences editing + PreferenceManager.getDefaultSharedPreferences(this).edit { putBoolean( OSMTracker.Preferences.KEY_DISPLAY_APP_INTRO, false diff --git a/app/src/main/java/net/osmtracker/activity/Preferences.java b/app/src/main/java/net/osmtracker/activity/Preferences.java index 61e79fc15..11960a7ae 100644 --- a/app/src/main/java/net/osmtracker/activity/Preferences.java +++ b/app/src/main/java/net/osmtracker/activity/Preferences.java @@ -22,7 +22,6 @@ import net.osmtracker.R; import java.io.File; -import java.util.Objects; /** * Manages preferences screen @@ -90,17 +89,15 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { getString(R.string.prefs_gps_logging_min_distance_empty), OSMTracker.Preferences.VAL_GPS_LOGGING_MIN_DISTANCE ); - // GPS Minimum Accuracy + // GPS Logging Minimum Accuracy setupEditTextNum( - OSMTracker.Preferences.KEY_GPS_MIN_ACCURACY, + OSMTracker.Preferences.KEY_GPS_LOGGING_MIN_ACCURACY, getString(R.string.prefs_gps_logging_min_distance_meters), getString(R.string.prefs_gps_min_accuracy_summary), - getString(R.string.prefs_gps_logging_interval_empty), - OSMTracker.Preferences.VAL_GPS_MIN_ACCURACY + getString(R.string.prefs_gps_min_accuracy_empty), + OSMTracker.Preferences.VAL_GPS_LOGGING_MIN_ACCURACY ); - - // GPX Settings setupStorageDirectory(); //Filename @@ -238,7 +235,7 @@ private void setupOSMAuthClearData(SharedPreferences prefs) { } /** - * Setup a preference that launches an activity via Intent + * Set up a preference that launches an activity via Intent * @param preferenceKey The preference key * @param intent The intent to launch */ @@ -344,7 +341,7 @@ public void onFragmentStarted( /** - * Setup a ListPreference with a custom two lines summary, displays the selected entry + * Set up a ListPreference with a custom two lines summary, displays the selected entry * on the first line, and the static summary on the second line. * * @param preferenceKey preference identifier @@ -358,8 +355,15 @@ private void setupListPreference(String preferenceKey, String staticSummary) { listPref.setSummaryProvider(preference -> { ListPreference lp = (ListPreference) preference; CharSequence entry = lp.getEntry(); - // Null check: entry might be null if no value is selected - String displayValue = Objects.requireNonNull(entry).toString(); + + // Handle cases where no value has been selected yet. (backwards compatibility) + String displayValue; + if (entry == null || TextUtils.isEmpty(entry)) { + // Fallback text if no value is set. + displayValue = getString(R.string.prefs_not_set); + } else { + displayValue = entry.toString(); + } return displayValue + ".\n" + staticSummary; }); } diff --git a/app/src/main/java/net/osmtracker/activity/TrackListRVAdapter.java b/app/src/main/java/net/osmtracker/activity/TrackListRVAdapter.java index 3f11a778b..230b51a16 100644 --- a/app/src/main/java/net/osmtracker/activity/TrackListRVAdapter.java +++ b/app/src/main/java/net/osmtracker/activity/TrackListRVAdapter.java @@ -52,6 +52,7 @@ public class TrackItemVH extends RecyclerView.ViewHolder private final TextView vNameOrStartDate; private final TextView vWps; private final TextView vTps; + private final TextView vNotesCount; private final ImageView vStatus; private final ImageView vUploadStatus; @@ -62,6 +63,7 @@ public TrackItemVH(View view) { vNameOrStartDate = (TextView) view.findViewById(R.id.trackmgr_item_nameordate); vWps = (TextView) view.findViewById(R.id.trackmgr_item_wps); vTps = (TextView) view.findViewById(R.id.trackmgr_item_tps); + vNotesCount = view.findViewById(R.id.trackmgr_item_notes_count); vStatus = (ImageView) view.findViewById(R.id.trackmgr_item_statusicon); vUploadStatus = (ImageView) view.findViewById(R.id.trackmgr_item_upload_statusicon); diff --git a/app/src/main/java/net/osmtracker/db/TracklistAdapter.java b/app/src/main/java/net/osmtracker/db/TracklistAdapter.java index d99c4ced8..fe45edae6 100644 --- a/app/src/main/java/net/osmtracker/db/TracklistAdapter.java +++ b/app/src/main/java/net/osmtracker/db/TracklistAdapter.java @@ -54,6 +54,7 @@ private View bind(Cursor cursor, View v, Context context) { TextView vNameOrStartDate = (TextView) v.findViewById(R.id.trackmgr_item_nameordate); TextView vWps = (TextView) v.findViewById(R.id.trackmgr_item_wps); TextView vTps = (TextView) v.findViewById(R.id.trackmgr_item_tps); + TextView vNotesCount = v.findViewById(R.id.trackmgr_item_notes_count); ImageView vStatus = (ImageView) v.findViewById(R.id.trackmgr_item_statusicon); ImageView vUploadStatus = (ImageView) v.findViewById(R.id.trackmgr_item_upload_statusicon); @@ -86,10 +87,11 @@ private View bind(Cursor cursor, View v, Context context) { String strTrackId = Long.toString(trackId); vId.setText(strTrackId); - // Bind WP count, TP count, name + // Bind WP count, TP count, Notes count, name Track t = Track.build(trackId, cursor, context.getContentResolver(), false); vTps.setText(Integer.toString(t.getTpCount())); vWps.setText(Integer.toString(t.getWpCount())); + vNotesCount.setText(Integer.toString(t.getNoteCount())); vNameOrStartDate.setText(t.getDisplayName()); return v; diff --git a/app/src/main/java/net/osmtracker/service/gps/GPSLogger.java b/app/src/main/java/net/osmtracker/service/gps/GPSLogger.java index 168dda5ed..e557afc87 100644 --- a/app/src/main/java/net/osmtracker/service/gps/GPSLogger.java +++ b/app/src/main/java/net/osmtracker/service/gps/GPSLogger.java @@ -67,6 +67,11 @@ public class GPSLogger extends Service implements LocationListener { */ private boolean isAccuracySatisfied = false; + /** + * Precision of the accuracy in meters is satisfied ? + */ + private boolean isAccuracySatisfied = false; + /** * Use barometer yes/no ? */ @@ -103,6 +108,10 @@ public class GPSLogger extends Service implements LocationListener { */ private long gpsLoggingInterval; private long gpsLoggingMinDistance; + /** + * Minimum accuracy in meters for starting defined in the preferences + */ + private long gpsLoggingMinAccuracy; /** * sensors for magnetic orientation @@ -257,6 +266,8 @@ public void onCreate() { OSMTracker.Preferences.KEY_GPS_LOGGING_INTERVAL, OSMTracker.Preferences.VAL_GPS_LOGGING_INTERVAL)) * 1000; gpsLoggingMinDistance = Long.parseLong(PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext()).getString( OSMTracker.Preferences.KEY_GPS_LOGGING_MIN_DISTANCE, OSMTracker.Preferences.VAL_GPS_LOGGING_MIN_DISTANCE)); + gpsLoggingMinAccuracy = Long.parseLong(PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext()).getString( + OSMTracker.Preferences.KEY_GPS_LOGGING_MIN_ACCURACY, OSMTracker.Preferences.VAL_GPS_LOGGING_MIN_ACCURACY)); use_barometer = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext()).getBoolean( OSMTracker.Preferences.KEY_USE_BAROMETER, OSMTracker.Preferences.VAL_USE_BAROMETER); @@ -365,7 +376,7 @@ public void onLocationChanged(Location location) { } // Wait for minimum accuracy before starting if(!isAccuracySatisfied){ - if(location.hasAccuracy() && location.getAccuracy() <= minAccuracy){ + if(location.hasAccuracy() && location.getAccuracy() <= gpsLoggingMinAccuracy){ // Precision achieved we unlocked the door and began recording this one and the following ones. isAccuracySatisfied = true; } diff --git a/app/src/main/res/layout/tracklist_item.xml b/app/src/main/res/layout/tracklist_item.xml index 7818fe44c..6eff9b5fb 100644 --- a/app/src/main/res/layout/tracklist_item.xml +++ b/app/src/main/res/layout/tracklist_item.xml @@ -105,6 +105,31 @@ app:layout_constraintTop_toTopOf="@id/trackmgr_item_trackpoints" app:layout_constraintBottom_toBottomOf="@id/trackmgr_item_trackpoints"/> + + + + Καλωσήρθατε στο OSMTracker για Android™ 👋 Αυτή η εφαρμοφή είναι δωρεάν λογισμικό το οποίο σέβεται της ελευθερία σας! + Καλή ιχνηλάτηση 🗺 😎 Το OSMTracker για Android θα χρησιμοποιήσει την τοποθεσία σας GPS για να καταγράψει σημεία ίχνους και σημεία διαδρομής, ακόμη κι αν εφαρμογή τρέχει στο παρασκήνιο.\nΤα δεδομένα σας δεν χρησιμοποιούνται για την υποστήριξη διαφημίσεων. diff --git a/app/src/main/res/values-es/strings-preferences.xml b/app/src/main/res/values-es/strings-preferences.xml index e0cce69d9..78be706ce 100644 --- a/app/src/main/res/values-es/strings-preferences.xml +++ b/app/src/main/res/values-es/strings-preferences.xml @@ -11,6 +11,13 @@ Ignorar el reloj GPS y utilizar el reloj Android como marcas de tiempo Registro de presión barométrica [hPa] Alternar requiere reiniciar la traza + Notas de texto + Escoja cómo se guardarán los valores del botón Nota de Texto de la disposición de botones + + Waypoint + Nota de OSM + Ambas + Intervalo de registro de GPS Utilice 0 para el más breve posible (afecta a la vida de la batería) segundos @@ -105,4 +112,5 @@ Exportar rumbo de la brújula Define el si y cómo los datos de brújula deben ser exportados al archivo GPX Reestablecer valor predeterminado + No establecido diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index a14147839..850fcda16 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -30,6 +30,7 @@ Lista de trazas: Puntos de ref.: P. de traza: + Notas: Usted no tiene ninguna traza. Presione para grabar una nueva traza. No se puede crear una nueva traza: {0} @@ -67,6 +68,7 @@ Descripción: Etiquetas (delimitado por comas) Debe introducir una descripción + Visibilidad Privado Público Trazable @@ -83,7 +85,13 @@ Error de autorización. ¿Desea borrar las credenciales de OSM guardadas? La subida a OpenStreetMap tuvo éxito + Subir notas a OpenStreetMap + Error al subir la nota + Nota de texto + Subir Cancelar + via %1$s %2$s + Error de autorización. Si usted previamente otorgó permisos a la aplicación para subir trazas, debe limpiar sus credenciales salvadas para autorizar la aplicación a subir trazas y notas. ¿Le gustaría limpiar sus credenciales de OpenStreetMap salvadas? Grabar voz Tomar foto @@ -100,11 +108,16 @@ Eliminar Cancelar + Texto/Nombre de la Nota Guardar Eliminar Cancelar + Eliminar nota + ¿Eliminar esta nota? Eliminar Cancelar + Lista de notas + Subir como nota de OSM Configuración Puntos @@ -261,6 +274,9 @@ Bienvenido a OSMTracker para Android ™ 👋 ¡Esta aplicación es un software libre que respeta tu libertad! + + ¿Qué novedades hay en esta versión? + Ya podemos subir notas a OSM, y los mosaicos de mapas de CyclOSM y OpenTopo vuelven a estar disponibles. ¡Disfruten! Feliz trazado 🗺 😎 OSMTracker para Android usará su ubicación GPS para registrar puntos de traza y puntos, incluso cuando la aplicación se está ejecutando en segundo plano. diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index b70ae59ef..81b82b032 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -262,6 +262,7 @@ Selecteer het in de lijst om door te gaan. Welkom bij OSMTracker voor Android™ 👋 Deze app is gratis software die uw vrijheid respecteert! + Veel plezier met tracken! 🗺 😎 OSMTracker voor Android zal uw gps-locatie gebruiken om trajectpunten en referentiepunten op te nemen, zelfs wanneer de app op de achtergrond actief is. diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 6d69f1b56..455903f58 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -257,6 +257,7 @@ głosową Witaj w OSMTracker Android™ 👋 Ta aplikacja jest wolnym oprogramowaniem i szanuje Twoją wolność! + Miłego zbierania śladów 🗺 😎 OSMTracker Android będzie używał Twojej pozycji GPS, aby zarejestrować punkty trasy i punkty orientacyjne, nawet jeśli aplikacja działa w tle. diff --git a/app/src/main/res/values-pt-rBR/strings-preferences.xml b/app/src/main/res/values-pt-rBR/strings-preferences.xml index 59c2a8999..cf1b49d03 100644 --- a/app/src/main/res/values-pt-rBR/strings-preferences.xml +++ b/app/src/main/res/values-pt-rBR/strings-preferences.xml @@ -11,12 +11,21 @@ Ignorar relógio do GPS e usar relógio do Android para os registros de tempo Log da pressão barométrica [hPa] Alternar requer o reinício da trilha + Notas de texto + Escolha como os valores do botão Texto da Nota nos layouts serão salvos. + + Waypoint + Nota do OSM + Ambas + Intervalo de registros do GPS Use 0 para o menor possível (afeta a duração da bateria) segundos + O intervalo de registro de GPS não pode estar vazio. Distância de registro do GPS Distância mínima entre os pontos da trilha em metros, use 0 para o mais curto possível metros + A distância mínima entre os pontos de rastreamento não pode ser vazia. Interface do usuário Fonte padrão das imagens Tirar foto com a câmera ou escolher da galeria? @@ -58,6 +67,7 @@ Configurações GPX Pasta do armazenamento nos documentos Terá efeito na próxima trilha (não na atual) + O valor da pasta de armazenamento não pode estar vazio. Uma pasta por trilha Salvar cada trilha e arquivos associados em uma pasta própria Nome do arquivo para trilhas nomeadas @@ -76,6 +86,14 @@ Preencha HDOP no GPX com um valor de aproximação de precisão Ativar som Tocar som quando gravação de voz começa e termina + Visibilidade da trilha + Visibilidade preferencial das trilhas enviadas para openstreetmap.org + + Privado + Rastreável + Público + Identificável + Redefinir autenticação OSM Esquecer as credenciais e permissões OSM e forçar o OSMTracker a perguntar isso novamente Você vai ter que autorizar OSMTracker para carregar trilhas novamente. Tem certeza? @@ -88,4 +106,6 @@ Exportar cabeçalho da bússola Define se e como os dados da bússola devem ser exportados para o arquivo GPX + Redefinir valor padrão + Não definido diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 53ff769bb..10a00ceed 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -30,6 +30,7 @@ Lista de trilhas: Pontos de referência: Trajeto: + Notas: Você não tem nenhuma trilha. Pressione para gravar uma nova trilha. Impossível criar uma nova trilha: {0} @@ -67,6 +68,7 @@ Descrição Tags (separado com vírgula) Você precisa digitar uma descrição + Visibilidade Privado Público Rastreável @@ -83,7 +85,13 @@ Erro de autorização. Gostaria de limpar as credencias do OpenStreetMaps salvas? Enviado com sucesso para o OpenStreetMap + Carregamento de notas do OpenStreetMap + Erro ao carregar a nota + Nota de texto + Enviar Cancelar + via %1$s %2$s + Erro de autorização. Se você já concedeu permissão ao aplicativo para enviar trilhas, é necessário limpar suas credenciais salvas para autorizar o aplicativo a enviar trilhas e notas. Deseja limpar suas credenciais salvas do OpenStreetMap? Gravar voz Tirar foto @@ -100,11 +108,16 @@ Apagar Cancelar + Nome/texto da nota Salvar Apagar Cancelar + Excluir nota + Apagar esta nota? Apagar Cancelar + Lista de notas + Enviar como nota OSM Configurações Pontos de referência @@ -261,6 +274,9 @@ Bem-vindo ao OSMTracker para Android ™ 👋 Este App é um software gratuito que respeita a sua liberdade! + + O que há de novo nesta versão? + Agora podemos enviar notas para o OSM, e os mapas CyclOSM e OpenTopo estão disponíveis novamente. Aproveitem! Boas trilhas 🗺 😎 OSMTracker para Android usará sua localização GPS para registrar trackpoints e waypoints, mesmo quando o aplicativo está sendo executado em segundo plano. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index b653ab5ff..18c8cc061 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -261,6 +261,7 @@ Добро пожаловать в OSMTracker для Android ™ 👋 Это свободное приложение, уважающее вашу свободу! + Удачного трекинга 🗺 😎 OSMTracker для Android будет использовать ваше местоположение по GPS для записи точек трека и путевых точек, даже если приложение работает в фоновом режиме. diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index aaeda263e..e7d3773a7 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -236,5 +236,6 @@ + diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 9762f4e78..342f67df9 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -261,6 +261,7 @@ Välkommen till OSMTracker for Android™ 👋 Den här appen är fri programvara som respekterar din frihet! + Lycka till med spårningen 🗺😎 OSMTracker för Android kommer att använda din GPS-position för att spela in spårpunkter och vägpunkter, även när appen körs i bakgrunden. diff --git a/app/src/main/res/values-zh-rTW/strings-preferences.xml b/app/src/main/res/values-zh-rTW/strings-preferences.xml index c6f6f6ee5..5fb5d1b2f 100644 --- a/app/src/main/res/values-zh-rTW/strings-preferences.xml +++ b/app/src/main/res/values-zh-rTW/strings-preferences.xml @@ -1,6 +1,5 @@ - 設定 GPS @@ -113,4 +112,5 @@ 匯出羅盤方位 定義羅盤資料要如何匯出到 GPX 檔案 重設預設值 + 還未設定 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 3a9a6ab73..6a4f503a7 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -274,6 +274,9 @@ 歡迎使用 OSMTracker for Android™👋 這款 App 是尊重你自由的自由軟體 + + 新版本推出什麼新功能呢? + 如今我們能夠上傳註解到 OSM,恢復介接 CyclOSM 以及 OpenTopo 圖磚。請享用! 記錄快樂🗺 😎 OSMTracker for Android 會使用你的 GPS 位置來記錄航點和路徑,即便 App 在背景執行。 diff --git a/app/src/main/res/values/strings-preferences.xml b/app/src/main/res/values/strings-preferences.xml index 308bc239c..eea238936 100644 --- a/app/src/main/res/values/strings-preferences.xml +++ b/app/src/main/res/values/strings-preferences.xml @@ -1,6 +1,5 @@ - Settings GPS @@ -30,6 +29,7 @@ GPS minimum accuracy Wait until accuracy is better than this value (in meters) to start recording. 0 to disable. Enter minimum accuracy (meters) + GPS logging accuracy cannot be empty User interface Default photo source Take photos from camera or gallery? @@ -121,4 +121,5 @@ Export compass heading Defines if and how the compass data should be exported to the GPX file Reset default value + Not set diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 381506590..277fe80e7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -274,6 +274,9 @@ Welcome to OSMTracker for Android™ 👋 This App is free software that respects your freedom! + + What\'s new in this version? + Now we can upload notes to OSM, and CyclOSM and OpenTopo map tiles are available again. Enjoy! Happy tracking 🗺 😎 OSMTracker for Android will use your GPS location to record trackpoints and waypoints, even when the App is running in background. diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index b29f9c4b8..54391062a 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -67,14 +67,13 @@ app:key="gps.logging.min_distance" app:summary="@string/prefs_gps_logging_min_distance_summary" app:title="@string/prefs_gps_logging_min_distance" /> - + app:defaultValue="0" + app:key="gps.logging.min.accuracy" + app:summary="@string/prefs_gps_min_accuracy_summary" + app:title="@string/prefs_gps_min_accuracy" + app:dialogTitle="@string/prefs_gps_min_accuracy_dialog_title" />