2020-01-02 17:00:37 +00:00
|
|
|
/*
|
|
|
|
* Keys.kt
|
|
|
|
* Implements the keys used throughout the app
|
|
|
|
* This object hosts all keys used to control Trackbook's state
|
|
|
|
*
|
|
|
|
* This file is part of
|
|
|
|
* TRACKBOOK - Movement Recorder for Android
|
|
|
|
*
|
|
|
|
* Copyright (c) 2016-20 - Y20K.org
|
|
|
|
* Licensed under the MIT-License
|
|
|
|
* http://opensource.org/licenses/MIT
|
|
|
|
*
|
|
|
|
* Trackbook uses osmdroid - OpenStreetMap-Tools for Android
|
|
|
|
* https://github.com/osmdroid/osmdroid
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
package org.y20k.trackbook
|
|
|
|
|
|
|
|
import java.util.*
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Keys object
|
|
|
|
*/
|
|
|
|
object Keys {
|
|
|
|
|
|
|
|
// application name
|
|
|
|
const val APPLICATION_NAME: String = "Trackbook"
|
|
|
|
|
|
|
|
// version numbers
|
|
|
|
const val CURRENT_TRACK_FORMAT_VERSION: Int = 4
|
|
|
|
const val CURRENT_TRACKLIST_FORMAT_VERSION: Int = 0
|
|
|
|
|
|
|
|
// intent actions
|
2020-05-30 15:22:52 +00:00
|
|
|
const val ACTION_START: String = "org.y20k.trackbook.action.START"
|
|
|
|
const val ACTION_STOP: String = "org.y20k.trackbook.action.STOP"
|
|
|
|
const val ACTION_RESUME: String = "org.y20k.trackbook.action.RESUME"
|
2020-01-02 17:00:37 +00:00
|
|
|
|
|
|
|
// args
|
|
|
|
const val ARG_TRACK_TITLE: String = "ArgTrackTitle"
|
|
|
|
const val ARG_TRACK_FILE_URI: String = "ArgTrackFileUri"
|
|
|
|
const val ARG_GPX_FILE_URI: String = "ArgGpxFileUri"
|
|
|
|
const val ARG_TRACK_ID: String = "ArgTrackId"
|
|
|
|
|
|
|
|
// preferences
|
2020-08-01 00:06:53 +00:00
|
|
|
const val PREF_ONE_TIME_HOUSEKEEPING_NECESSARY =
|
|
|
|
"ONE_TIME_HOUSEKEEPING_NECESSARY_VERSIONCODE_38" // increment to current app version code to trigger housekeeping that runs only once
|
|
|
|
const val PREF_THEME_SELECTION: String = "prefThemeSelection"
|
2020-01-02 17:00:37 +00:00
|
|
|
const val PREF_CURRENT_BEST_LOCATION_PROVIDER: String = "prefCurrentBestLocationProvider"
|
|
|
|
const val PREF_CURRENT_BEST_LOCATION_LATITUDE: String = "prefCurrentBestLocationLatitude"
|
|
|
|
const val PREF_CURRENT_BEST_LOCATION_LONGITUDE: String = "prefCurrentBestLocationLongitude"
|
|
|
|
const val PREF_CURRENT_BEST_LOCATION_ACCURACY: String = "prefCurrentBestLocationAccuracy"
|
|
|
|
const val PREF_CURRENT_BEST_LOCATION_ALTITUDE: String = "prefCurrentBestLocationAltitude"
|
|
|
|
const val PREF_CURRENT_BEST_LOCATION_TIME: String = "prefCurrentBestLocationTime"
|
|
|
|
const val PREF_MAP_ZOOM_LEVEL: String = "prefMapZoomLevel"
|
|
|
|
const val PREF_TRACKING_STATE: String = "prefTrackingState"
|
|
|
|
const val PREF_USE_IMPERIAL_UNITS: String = "prefUseImperialUnits"
|
|
|
|
const val PREF_GPS_ONLY: String = "prefGpsOnly"
|
|
|
|
const val PREF_LOCATION_ACCURACY_THRESHOLD: String = "prefLocationAccuracyThreshold"
|
|
|
|
const val PREF_LOCATION_AGE_THRESHOLD: String = "prefLocationAgeThreshold"
|
|
|
|
|
|
|
|
// states
|
2020-01-28 16:39:45 +00:00
|
|
|
const val STATE_TRACKING_NOT: Int = 0
|
2020-01-02 17:00:37 +00:00
|
|
|
const val STATE_TRACKING_ACTIVE: Int = 1
|
|
|
|
const val STATE_TRACKING_STOPPED: Int = 2
|
2020-01-28 16:39:45 +00:00
|
|
|
const val STATE_THEME_FOLLOW_SYSTEM: String = "stateFollowSystem"
|
|
|
|
const val STATE_THEME_LIGHT_MODE: String = "stateLightMode"
|
|
|
|
const val STATE_THEME_DARK_MODE: String = "stateDarkMode"
|
2020-01-02 17:00:37 +00:00
|
|
|
|
|
|
|
// dialog types
|
|
|
|
const val DIALOG_EMPTY_RECORDING: Int = 0
|
2020-03-09 14:39:48 +00:00
|
|
|
const val DIALOG_DELETE_TRACK: Int = 1
|
|
|
|
const val DIALOG_DELETE_NON_STARRED: Int = 2
|
2020-01-02 17:00:37 +00:00
|
|
|
|
|
|
|
// dialog results
|
|
|
|
const val DIALOG_EMPTY_PAYLOAD_STRING: String = ""
|
|
|
|
const val DIALOG_EMPTY_PAYLOAD_INT: Int = -1
|
|
|
|
|
|
|
|
// folder names
|
2020-08-01 00:06:53 +00:00
|
|
|
const val FOLDER_TEMP: String = "temp"
|
2020-01-02 17:00:37 +00:00
|
|
|
const val FOLDER_TRACKS: String = "tracks"
|
|
|
|
const val FOLDER_GPX: String = "gpx"
|
|
|
|
|
|
|
|
// file names and extensions
|
2020-02-13 16:12:34 +00:00
|
|
|
const val MIME_TYPE_GPX: String = "application/gpx+xml"
|
2020-01-02 17:00:37 +00:00
|
|
|
const val GPX_FILE_EXTENSION: String = ".gpx"
|
|
|
|
const val TRACKBOOK_LEGACY_FILE_EXTENSION: String = ".trackbook"
|
|
|
|
const val TRACKBOOK_FILE_EXTENSION: String = ".json"
|
|
|
|
const val TEMP_FILE: String = "temp.json"
|
|
|
|
const val TRACKLIST_FILE: String = "tracklist.json"
|
|
|
|
|
|
|
|
|
|
|
|
// default values
|
|
|
|
val DEFAULT_DATE: Date = Date(0L)
|
|
|
|
const val DEFAULT_RFC2822_DATE: String = "Thu, 01 Jan 1970 01:00:00 +0100" // --> Date(0)
|
|
|
|
const val ONE_HOUR_IN_MILLISECONDS: Int = 3600000
|
|
|
|
const val EMPTY_STRING_RESOURCE: Int = 0
|
2020-08-01 00:06:53 +00:00
|
|
|
const val REQUEST_CURRENT_LOCATION_INTERVAL: Long =
|
|
|
|
1000L // 1 second in milliseconds
|
|
|
|
const val ADD_WAYPOINT_TO_TRACK_INTERVAL: Long =
|
|
|
|
15000L // 15 seconds in milliseconds
|
|
|
|
const val SIGNIFICANT_TIME_DIFFERENCE: Long =
|
|
|
|
120000L // 2 minutes in milliseconds
|
|
|
|
const val STOP_OVER_THRESHOLD: Long =
|
|
|
|
300000L // 5 minutes in milliseconds
|
2020-03-24 14:26:01 +00:00
|
|
|
const val IMPLAUSIBLE_TRACK_START_SPEED: Double = 250.0 // 250 km/h
|
2020-08-01 00:06:53 +00:00
|
|
|
const val DEFAULT_LATITUDE: Double =
|
|
|
|
71.172500 // latitude Nordkapp, Norway
|
|
|
|
const val DEFAULT_LONGITUDE: Double =
|
|
|
|
25.784444 // longitude Nordkapp, Norway
|
2020-01-02 17:00:37 +00:00
|
|
|
const val DEFAULT_ACCURACY: Float = 300f // in meters
|
|
|
|
const val DEFAULT_ALTITUDE: Double = 0.0
|
|
|
|
const val DEFAULT_TIME: Long = 0L
|
|
|
|
const val DEFAULT_THRESHOLD_LOCATION_ACCURACY: Int = 30 // 30 meters
|
2020-08-01 00:06:53 +00:00
|
|
|
const val DEFAULT_THRESHOLD_LOCATION_AGE: Long =
|
|
|
|
60000000000L // one minute in nanoseconds
|
2020-01-02 17:00:37 +00:00
|
|
|
const val DEFAULT_THRESHOLD_DISTANCE: Float = 15f // 15 meters
|
|
|
|
const val DEFAULT_ZOOM_LEVEL: Double = 16.0
|
2020-08-01 00:06:53 +00:00
|
|
|
const val ALTITUDE_MEASUREMENT_ERROR_THRESHOLD =
|
|
|
|
10 // altitude changes of 10 meter or more (per 15 seconds) are being discarded
|
2020-01-02 17:00:37 +00:00
|
|
|
const val REQUEST_CODE_FOREGROUND = 42
|
|
|
|
|
|
|
|
// requests
|
2020-02-13 16:12:34 +00:00
|
|
|
const val REQUEST_SAVE_GPX: Int = 23
|
2020-01-02 17:00:37 +00:00
|
|
|
|
|
|
|
// notification
|
|
|
|
const val TRACKER_SERVICE_NOTIFICATION_ID: Int = 1
|
|
|
|
const val NOTIFICATION_CHANNEL_RECORDING: String = "notificationChannelIdRecordingChannel"
|
|
|
|
}
|