Stay organized with collections
Save and categorize content based on your preferences.
Callback
abstract class Callback
Used for receiving GNSS satellite measurements from the GNSS engine. Each measurement contains raw and computed data identifying a satellite. You can implement this interface and call android.location.LocationManager#registerGnssMeasurementsCallback.
Summary
Constants |
static Int |
GPS provider or Location is disabled, updates will not be received until they are enabled.
|
static Int |
The client is not allowed to register for GNSS Measurements in general or in the requested mode.
|
static Int |
The system does not support tracking of GNSS Measurements.
|
static Int |
GNSS Measurements are successfully being tracked, it will receive updates once they are available.
|
Public methods |
open Unit |
Reports the latest collected GNSS Measurements.
|
open Unit |
Reports the latest status of the GNSS Measurements sub-system.
|
Constants
STATUS_LOCATION_DISABLED
static val STATUS_LOCATION_DISABLED: Int
Deprecated: Do not use.
GPS provider or Location is disabled, updates will not be received until they are enabled.
Value: 2
STATUS_NOT_ALLOWED
static val STATUS_NOT_ALLOWED: Int
Deprecated: Do not use.
The client is not allowed to register for GNSS Measurements in general or in the requested mode.
Such a status is returned when a client tries to request a functionality from the GNSS chipset while another client has an ongoing request that does not allow such functionality to be performed.
If such a status is received, one would try again at a later time point where no other client is having a conflicting request.
Value: 3
STATUS_NOT_SUPPORTED
static val STATUS_NOT_SUPPORTED: Int
Deprecated: Do not use.
The system does not support tracking of GNSS Measurements.
This status will not change in the future.
Value: 0
STATUS_READY
static val STATUS_READY: Int
Deprecated: Do not use.
GNSS Measurements are successfully being tracked, it will receive updates once they are available.
Value: 1
Public constructors
Public methods
onGnssMeasurementsReceived
open fun onGnssMeasurementsReceived(eventArgs: GnssMeasurementsEvent!): Unit
Reports the latest collected GNSS Measurements.
onStatusChanged
open fun onStatusChanged(status: Int): Unit
Deprecated: Do not rely on this callback. From Android S onwards this callback will be invoked once with STATUS_READY
in all cases for backwards compatibility, and then never invoked again. Use LocationManager APIs if you need to determine if GNSS measurements are supported or if location is off, etc...
Reports the latest status of the GNSS Measurements sub-system.
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-02-10 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-02-10 UTC."],[],[],null,["# GnssMeasurementsEvent.Callback\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCallback\n========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/location/GnssMeasurementsEvent.Callback \"View this page in Java\") \n\n```\nabstract class Callback\n```\n\n|---|------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.location.GnssMeasurementsEvent.Callback](#) |\n\nUsed for receiving GNSS satellite measurements from the GNSS engine. Each measurement contains raw and computed data identifying a satellite. You can implement this interface and call android.location.LocationManager#registerGnssMeasurementsCallback.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [STATUS_LOCATION_DISABLED](#STATUS_LOCATION_DISABLED:kotlin.Int) GPS provider or Location is disabled, updates will not be received until they are enabled. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [STATUS_NOT_ALLOWED](#STATUS_NOT_ALLOWED:kotlin.Int) The client is not allowed to register for GNSS Measurements in general or in the requested mode. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [STATUS_NOT_SUPPORTED](#STATUS_NOT_SUPPORTED:kotlin.Int) The system does not support tracking of GNSS Measurements. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [STATUS_READY](#STATUS_READY:kotlin.Int) GNSS Measurements are successfully being tracked, it will receive updates once they are available. |\n\n| Public constructors ||\n|------------------------------------|---|\n| [Callback](#Callback())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onGnssMeasurementsReceived](#onGnssMeasurementsReceived(android.location.GnssMeasurementsEvent))`(`eventArgs:` `[GnssMeasurementsEvent](/reference/kotlin/android/location/GnssMeasurementsEvent)!`)` Reports the latest collected GNSS Measurements. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onStatusChanged](#onStatusChanged(kotlin.Int))`(`status:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Reports the latest status of the GNSS Measurements sub-system. |\n\nConstants\n---------\n\n### STATUS_LOCATION_DISABLED\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val STATUS_LOCATION_DISABLED: Int\n```\n\n**Deprecated:** *Do not use.*\n\nGPS provider or Location is disabled, updates will not be received until they are enabled. \n\n Value: 2\n\n### STATUS_NOT_ALLOWED\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val STATUS_NOT_ALLOWED: Int\n```\n\n**Deprecated:** *Do not use.*\n\nThe client is not allowed to register for GNSS Measurements in general or in the requested mode.\n\nSuch a status is returned when a client tries to request a functionality from the GNSS chipset while another client has an ongoing request that does not allow such functionality to be performed.\n\nIf such a status is received, one would try again at a later time point where no other client is having a conflicting request. \n\n Value: 3\n\n### STATUS_NOT_SUPPORTED\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val STATUS_NOT_SUPPORTED: Int\n```\n\n**Deprecated:** *Do not use.*\n\nThe system does not support tracking of GNSS Measurements.\n\nThis status will not change in the future. \n\n Value: 0\n\n### STATUS_READY\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val STATUS_READY: Int\n```\n\n**Deprecated:** *Do not use.*\n\nGNSS Measurements are successfully being tracked, it will receive updates once they are available. \n\n Value: 1\n\nPublic constructors\n-------------------\n\n### Callback\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nCallback()\n```\n\nPublic methods\n--------------\n\n### onGnssMeasurementsReceived\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onGnssMeasurementsReceived(eventArgs: GnssMeasurementsEvent!): Unit\n```\n\nReports the latest collected GNSS Measurements. \n\n### onStatusChanged\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onStatusChanged(status: Int): Unit\n```\n\n**Deprecated:** *Do not rely on this callback. From Android S onwards this callback will be invoked once with [STATUS_READY](#STATUS_READY:kotlin.Int) in all cases for backwards compatibility, and then never invoked again. Use LocationManager APIs if you need to determine if GNSS measurements are supported or if location is off, etc...*\n\nReports the latest status of the GNSS Measurements sub-system.\n\n| Parameters ||\n|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `status` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is [android.location.GnssMeasurementsEvent.Callback#STATUS_NOT_SUPPORTED](#STATUS_NOT_SUPPORTED:kotlin.Int), [android.location.GnssMeasurementsEvent.Callback#STATUS_READY](#STATUS_READY:kotlin.Int), [android.location.GnssMeasurementsEvent.Callback#STATUS_LOCATION_DISABLED](#STATUS_LOCATION_DISABLED:kotlin.Int), or [android.location.GnssMeasurementsEvent.Callback#STATUS_NOT_ALLOWED](#STATUS_NOT_ALLOWED:kotlin.Int) |"]]