Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder class for Location
Summary
Public constructors |
Sets time, longitude and latitude to the point.
|
Public constructors
Builder
Builder(
time: Instant,
latitude: Double,
longitude: Double)
Sets time, longitude and latitude to the point.
Parameters |
time |
Instant: This value cannot be null . |
latitude |
Double: Value is between -90.0f and 90.0f inclusive |
longitude |
Double: Value is between -180.0f and 180.0f inclusive |
Public methods
setHorizontalAccuracy
fun setHorizontalAccuracy(horizontalAccuracy: Length): ExerciseRoute.Location.Builder
Sets horizontal accuracy to the point.
Parameters |
horizontalAccuracy |
Length: This value cannot be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[],[],null,["# ExerciseRoute.Location.Builder\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/health/connect/datatypes/ExerciseRoute.Location.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|----------------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.health.connect.datatypes.ExerciseRoute.Location.Builder](#) |\n\nBuilder class for [Location](/reference/kotlin/android/health/connect/datatypes/ExerciseRoute.Location)\n\nSummary\n-------\n\n| Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(java.time.Instant,%20kotlin.Double,%20kotlin.Double))`(`time:` `[Instant](../../../../java/time/Instant.html#)`, `latitude:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`, `longitude:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`)` Sets time, longitude and latitude to the point. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ExerciseRoute.Location](/reference/kotlin/android/health/connect/datatypes/ExerciseRoute.Location) | [build](#build())`()` Builds [Location](/reference/kotlin/android/health/connect/datatypes/ExerciseRoute.Location) |\n| [ExerciseRoute.Location.Builder](#) | [setAltitude](#setAltitude(android.health.connect.datatypes.units.Length))`(`altitude:` `[Length](/reference/kotlin/android/health/connect/datatypes/units/Length)`)` Sets altitude to the point. |\n| [ExerciseRoute.Location.Builder](#) | [setHorizontalAccuracy](#setHorizontalAccuracy(android.health.connect.datatypes.units.Length))`(`horizontalAccuracy:` `[Length](/reference/kotlin/android/health/connect/datatypes/units/Length)`)` Sets horizontal accuracy to the point. |\n| [ExerciseRoute.Location.Builder](#) | [setVerticalAccuracy](#setVerticalAccuracy(android.health.connect.datatypes.units.Length))`(`verticalAccuracy:` `[Length](/reference/kotlin/android/health/connect/datatypes/units/Length)`)` Sets vertical accuracy to the point. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(\n time: Instant, \n latitude: Double, \n longitude: Double)\n```\n\nSets time, longitude and latitude to the point.\n\n| Parameters ||\n|-------------|---------------------------------------------------------------------------------------------------------------------------------|\n| `time` | [Instant](../../../../java/time/Instant.html#): This value cannot be `null`. |\n| `latitude` | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html): Value is between -90.0f and 90.0f inclusive |\n| `longitude` | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html): Value is between -180.0f and 180.0f inclusive |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): ExerciseRoute.Location\n```\n\nBuilds [Location](/reference/kotlin/android/health/connect/datatypes/ExerciseRoute.Location)\n\n| Return ||\n|-----------------------------------------------------------------------------------------------------|------------------------------|\n| [ExerciseRoute.Location](/reference/kotlin/android/health/connect/datatypes/ExerciseRoute.Location) | This value cannot be `null`. |\n\n### setAltitude\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setAltitude(altitude: Length): ExerciseRoute.Location.Builder\n```\n\nSets altitude to the point.\n\n| Parameters ||\n|------------|---------------------------------------------------------------------------------------------------------|\n| `altitude` | [Length](/reference/kotlin/android/health/connect/datatypes/units/Length): This value cannot be `null`. |\n\n| Return ||\n|-------------------------------------|------------------------------|\n| [ExerciseRoute.Location.Builder](#) | This value cannot be `null`. |\n\n### setHorizontalAccuracy\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setHorizontalAccuracy(horizontalAccuracy: Length): ExerciseRoute.Location.Builder\n```\n\nSets horizontal accuracy to the point.\n\n| Parameters ||\n|----------------------|---------------------------------------------------------------------------------------------------------|\n| `horizontalAccuracy` | [Length](/reference/kotlin/android/health/connect/datatypes/units/Length): This value cannot be `null`. |\n\n| Return ||\n|-------------------------------------|------------------------------|\n| [ExerciseRoute.Location.Builder](#) | This value cannot be `null`. |\n\n### setVerticalAccuracy\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setVerticalAccuracy(verticalAccuracy: Length): ExerciseRoute.Location.Builder\n```\n\nSets vertical accuracy to the point.\n\n| Parameters ||\n|--------------------|---------------------------------------------------------------------------------------------------------|\n| `verticalAccuracy` | [Length](/reference/kotlin/android/health/connect/datatypes/units/Length): This value cannot be `null`. |\n\n| Return ||\n|-------------------------------------|------------------------------|\n| [ExerciseRoute.Location.Builder](#) | This value cannot be `null`. |"]]