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-03 08:59:56 +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-03 08:59:56 +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-03 08:59:56 +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-03 08:59:56 +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-03 08:59:56 +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-03 08:59:56 +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 "
}