Added in API level 24

Callback

abstract class Callback
kotlin.Any
   ↳ android.location.GnssMeasurementsEvent.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 constructors

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

Added in API level 24
Deprecated in API level 31
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

Added in API level 28
Deprecated in API level 31
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

Added in API level 24
Deprecated in API level 31
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

Added in API level 24
Deprecated in API level 31
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

Callback

Added in API level 24
Callback()

Public methods

onGnssMeasurementsReceived

Added in API level 24
open fun onGnssMeasurementsReceived(eventArgs: GnssMeasurementsEvent!): Unit

Reports the latest collected GNSS Measurements.

onStatusChanged

Added in API level 24
Deprecated in API level 31
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.

Parameters
status Int: Value is android.location.GnssMeasurementsEvent.Callback#STATUS_NOT_SUPPORTED, android.location.GnssMeasurementsEvent.Callback#STATUS_READY, android.location.GnssMeasurementsEvent.Callback#STATUS_LOCATION_DISABLED, or android.location.GnssMeasurementsEvent.Callback#STATUS_NOT_ALLOWED