Stay organized with collections
Save and categorize content based on your preferences.
Callback
abstract class Callback
Used for receiving GNSS satellite Navigation Messages from the GNSS engine.
You can implement this interface and call android.location.LocationManager#registerGnssNavigationMessageCallback.
Summary
Constants |
static Int |
GNSS provider or Location is disabled, updated will not be received until they are enabled.
|
static Int |
The system does not support tracking of GNSS Navigation Messages.
|
static Int |
GNSS Navigation Messages are successfully being tracked, it will receive updates once they are available.
|
Public methods |
open Unit |
Returns the latest collected GNSS Navigation Message.
|
open Unit |
Returns the latest status of the GNSS Navigation Messages sub-system.
|
Constants
STATUS_LOCATION_DISABLED
static val STATUS_LOCATION_DISABLED: Int
Deprecated: Do not use.
GNSS provider or Location is disabled, updated will not be received until they are enabled.
Value: 2
STATUS_NOT_SUPPORTED
static val STATUS_NOT_SUPPORTED: Int
Deprecated: Do not use.
The system does not support tracking of GNSS Navigation Messages. This status will not change in the future.
Value: 0
STATUS_READY
static val STATUS_READY: Int
Deprecated: Do not use.
GNSS Navigation Messages are successfully being tracked, it will receive updates once they are available.
Value: 1
Public constructors
Public methods
onGnssNavigationMessageReceived
open fun onGnssNavigationMessageReceived(event: GnssNavigationMessage!): Unit
Returns the latest collected GNSS Navigation Message.
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 navigation messages are supported or if location is off, etc...
Returns the latest status of the GNSS Navigation Messages 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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# GnssNavigationMessage.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/GnssNavigationMessage.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.GnssNavigationMessage.Callback](#) |\n\nUsed for receiving GNSS satellite Navigation Messages from the GNSS engine.\n\nYou can implement this interface and call android.location.LocationManager#registerGnssNavigationMessageCallback.\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) GNSS provider or Location is disabled, updated will not be received until they are enabled. |\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 Navigation Messages. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [STATUS_READY](#STATUS_READY:kotlin.Int) GNSS Navigation Messages 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) | [onGnssNavigationMessageReceived](#onGnssNavigationMessageReceived(android.location.GnssNavigationMessage))`(`event:` `[GnssNavigationMessage](/reference/kotlin/android/location/GnssNavigationMessage)!`)` Returns the latest collected GNSS Navigation Message. |\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)`)` Returns the latest status of the GNSS Navigation Messages 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\nGNSS provider or Location is disabled, updated will not be received until they are enabled. \n\n Value: 2\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 Navigation Messages. This 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 Navigation Messages 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### onGnssNavigationMessageReceived\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onGnssNavigationMessageReceived(event: GnssNavigationMessage!): Unit\n```\n\nReturns the latest collected GNSS Navigation Message. \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 navigation messages are supported or if location is off, etc...*\n\nReturns the latest status of the GNSS Navigation Messages sub-system.\n\n| Parameters ||\n|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `status` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is [android.location.GnssNavigationMessage.Callback#STATUS_NOT_SUPPORTED](#STATUS_NOT_SUPPORTED:kotlin.Int), [android.location.GnssNavigationMessage.Callback#STATUS_READY](#STATUS_READY:kotlin.Int), or [android.location.GnssNavigationMessage.Callback#STATUS_LOCATION_DISABLED](#STATUS_LOCATION_DISABLED:kotlin.Int) |"]]