Get Tracks
**
* Returns tracks information. (tracks are cached in local DB)
*
* @param locale Language in which tracks are to arrive.
* @param startDate Start date format "yyyy-MM-dd'T'HH:mm:ss ZZ" or null.
* @param endDate End date format "yyyy-MM-dd'T'HH:mm:ss ZZ" or null.
* @param offset Offset numb for pagination.
* @param count Count items for pagination.
*/
// IMPORTANT! Do not call this method in the Main thread.
fun *getTracks(locale: Locale,
startDate: String,
endDate: String,
offset: Int,
count: Int): Array<Track>
Response:
Array of
class Track(
/**
* The start address.
*/
var addressStart: String?,
/**
* The end address.
*/
var addressEnd: String?,
/**
* The start date in "yyyy-MM-dd'T'HH:mm:ss ZZ" format.
*/
var endDate: String?,
/**
* The end date in "yyyy-MM-dd'T'HH:mm:ss ZZ" format.
*/
var startDate: String?,
/**
* The unique trip id.
*/
var trackId: String?,
/**
* The count of sharp acceleration.
*/
var accelerationCount: Int,
/**
* The count of sharp braking.
*/
var decelerationCount: Int,
/**
* The distance trip in km.
*/
var distance: Double,
/**
* The trip duration.
*/
var duration: Double,
/**
* The trip rating. Range 1..5
*/
var rating: Double,
/**
* The trip phone usage in minutes.
*/
var phoneUsage: Double,
/**
* The trip type.
* See also [TripOriginDictionary.code]
*/
var originalCode: String?,
/**
* The trip type has changed. If false - origin trip type can be changed. If false - can't be changed.
* [TripOriginDictionary.code]
*/
var hasOriginChanged: Boolean,
/**
* Total distance travelled(in km) while exceeding speed limit over for 10 to 20 km/h
*/
var midOverSpeedMileage: Double,
/**
* Total distance travelled(in km) while exceeding the speed limit over for 20 km/h or more.
*/
var highOverSpeedMileage: Double,
/**
* Driving tips.
*/
var drivingTips: String?,
var shareType: String?,
var cityStart: String?,
var cityFinish: String?
var ratingCornering: Double,
var ratingAcceleration: Double,
var ratingBraking: Double,
var ratingSpeeding: Double,
var ratingPhoneUsage: Double,
var ratingTimeOfDay: Double,
var addressStartParts: AddressParts?,
var addressFinishParts: AddressParts?,
/**
* List of tags.
*/
val tags: Array<TrackTag>?
)
data class AddressParts(
var countryCode: String?,
var country: String?,
var county: String?,
var postalCode: String?,
var state: String?,
var city: String?,
var distinct: String?,
var street: String?,
var house: String?
)
data class TrackTag(
/**
* Tag name.
*/
var name: String? = null,
/**
* Source type. Maybe: "Sdk", "UserApp".
*/
var sourceType: String? = null,
/**
* Source. For ex. App module (optional)
*/
var source: String? = null
) {
override fun toString(): String {
return "TrackTag(name=$name, sourceType=$sourceType,
source=$source)"
}
}
Last updated