GnssStatusCompat

abstract class GnssStatusCompat
kotlin.Any
   ↳ androidx.core.location.GnssStatusCompat

GnssStatus representation that works across all Android versions. See GnssStatus and GpsStatus.

Note: When used to wrap GpsStatus, the best performance can be obtained by using a monotonically increasing satelliteIndex parameter (for instance, by using a loop from 0 to getSatelliteCount()). Random access is supported but performance may suffer.

Summary

Nested classes
abstract

See GnssStatus.Callback.

Constants
static Int

Constellation type constant for Beidou.

static Int

Constellation type constant for Galileo.

static Int

Constellation type constant for Glonass.

static Int

Constellation type constant for GPS.

static Int

Constellation type constant for IRNSS.

static Int

Constellation type constant for QZSS.

static Int

Constellation type constant for SBAS.

static Int

Unknown constellation type.

Public methods
abstract Float
getAzimuthDegrees(@IntRange(0) satelliteIndex: Int)

See GnssStatus#getAzimuthDegrees(int) and GpsSatellite#getAzimuth().

abstract Float
getCarrierFrequencyHz(@IntRange(0) satelliteIndex: Int)

See GnssStatus#getCarrierFrequencyHz(int).

abstract Float
getCn0DbHz(@IntRange(0) satelliteIndex: Int)

See GnssStatus#getCn0DbHz(int) and GpsSatellite#getSnr().

abstract Int
getConstellationType(@IntRange(0) satelliteIndex: Int)

See GnssStatus#getConstellationType(int).

abstract Float
getElevationDegrees(@IntRange(0) satelliteIndex: Int)

See GnssStatus#getElevationDegrees(int) and GpsSatellite#getElevation().

abstract Int

See GnssStatus#getSatelliteCount() and GpsStatus#getMaxSatellites().

abstract Int
getSvid(@IntRange(0) satelliteIndex: Int)

See GnssStatus#getSvid(int) and GpsSatellite#getPrn().

abstract Boolean
hasAlmanacData(@IntRange(0) satelliteIndex: Int)

See GnssStatus#hasAlmanacData(int) and GpsSatellite#hasAlmanac().

abstract Boolean
hasCarrierFrequencyHz(@IntRange(0) satelliteIndex: Int)

See GnssStatus#hasCarrierFrequencyHz(int).

abstract Boolean
hasEphemerisData(@IntRange(0) satelliteIndex: Int)

See GnssStatus#hasEphemerisData(int) and GpsSatellite#hasEphemeris().

abstract Boolean
usedInFix(@IntRange(0) satelliteIndex: Int)

See GnssStatus#usedInFix(int) and GpsSatellite#usedInFix().

open static GnssStatusCompat
wrap(@NonNull gnssStatus: GnssStatus)

Wraps the given GnssStatus as GnssStatusCompat.

open static GnssStatusCompat
wrap(@NonNull gpsStatus: GpsStatus)

Wraps the given GpsStatus as GnssStatusCompat.

Constants

CONSTELLATION_BEIDOU

static val CONSTELLATION_BEIDOU: Int

Constellation type constant for Beidou.

Value: GnssStatus.CONSTELLATION_BEIDOU

CONSTELLATION_GALILEO

static val CONSTELLATION_GALILEO: Int

Constellation type constant for Galileo.

Value: GnssStatus.CONSTELLATION_GALILEO

CONSTELLATION_GLONASS

static val CONSTELLATION_GLONASS: Int

Constellation type constant for Glonass.

Value: GnssStatus.CONSTELLATION_GLONASS

CONSTELLATION_GPS

static val CONSTELLATION_GPS: Int

Constellation type constant for GPS.

Value: GnssStatus.CONSTELLATION_GPS

CONSTELLATION_IRNSS

static val CONSTELLATION_IRNSS: Int

Constellation type constant for IRNSS.

Value: GnssStatus.CONSTELLATION_IRNSS

CONSTELLATION_QZSS

static val CONSTELLATION_QZSS: Int

Constellation type constant for QZSS.

Value: GnssStatus.CONSTELLATION_QZSS

CONSTELLATION_SBAS

static val CONSTELLATION_SBAS: Int

Constellation type constant for SBAS.

Value: GnssStatus.CONSTELLATION_SBAS

CONSTELLATION_UNKNOWN

static val CONSTELLATION_UNKNOWN: Int

Unknown constellation type.

Value: GnssStatus.CONSTELLATION_UNKNOWN

Public methods

getAzimuthDegrees

@FloatRange(0, 360) abstract fun getAzimuthDegrees(@IntRange(0) satelliteIndex: Int): Float

See GnssStatus#getAzimuthDegrees(int) and GpsSatellite#getAzimuth().

Parameters
satelliteIndex Int: A index from zero to getSatelliteCount() - 1

getCarrierFrequencyHz

@FloatRange(0) abstract fun getCarrierFrequencyHz(@IntRange(0) satelliteIndex: Int): Float

See GnssStatus#getCarrierFrequencyHz(int). Behavior is undefined if hasCarrierFrequencyHz(int) returns false.

Parameters
satelliteIndex Int: A index from zero to getSatelliteCount() - 1

getCn0DbHz

@FloatRange(0, 63) abstract fun getCn0DbHz(@IntRange(0) satelliteIndex: Int): Float

See GnssStatus#getCn0DbHz(int) and GpsSatellite#getSnr().

Parameters
satelliteIndex Int: A index from zero to getSatelliteCount() - 1

getConstellationType

abstract fun getConstellationType(@IntRange(0) satelliteIndex: Int): Int

See GnssStatus#getConstellationType(int). Will always return a value for the GPS constellation below Android N.

Parameters
satelliteIndex Int: A index from zero to getSatelliteCount() - 1

getElevationDegrees

@FloatRange(-90, 90) abstract fun getElevationDegrees(@IntRange(0) satelliteIndex: Int): Float

See GnssStatus#getElevationDegrees(int) and GpsSatellite#getElevation().

Parameters
satelliteIndex Int: A index from zero to getSatelliteCount() - 1

getSatelliteCount

@IntRange(0) abstract fun getSatelliteCount(): Int

See GnssStatus#getSatelliteCount() and GpsStatus#getMaxSatellites().

getSvid

@IntRange(1, 200) abstract fun getSvid(@IntRange(0) satelliteIndex: Int): Int

See GnssStatus#getSvid(int) and GpsSatellite#getPrn().

Parameters
satelliteIndex Int: A index from zero to getSatelliteCount() - 1

hasAlmanacData

abstract fun hasAlmanacData(@IntRange(0) satelliteIndex: Int): Boolean

See GnssStatus#hasAlmanacData(int) and GpsSatellite#hasAlmanac().

Parameters
satelliteIndex Int: A index from zero to getSatelliteCount() - 1

hasCarrierFrequencyHz

abstract fun hasCarrierFrequencyHz(@IntRange(0) satelliteIndex: Int): Boolean

See GnssStatus#hasCarrierFrequencyHz(int). This will always return false prior to Android O.

Parameters
satelliteIndex Int: A index from zero to getSatelliteCount() - 1

hasEphemerisData

abstract fun hasEphemerisData(@IntRange(0) satelliteIndex: Int): Boolean

See GnssStatus#hasEphemerisData(int) and GpsSatellite#hasEphemeris().

Parameters
satelliteIndex Int: A index from zero to getSatelliteCount() - 1

usedInFix

abstract fun usedInFix(@IntRange(0) satelliteIndex: Int): Boolean

See GnssStatus#usedInFix(int) and GpsSatellite#usedInFix().

Parameters
satelliteIndex Int: A index from zero to getSatelliteCount() - 1

wrap

@RequiresApi(24) @NonNull open static fun wrap(@NonNull gnssStatus: GnssStatus): GnssStatusCompat

Wraps the given GnssStatus as GnssStatusCompat.

wrap

@NonNull open static fun wrap(@NonNull gpsStatus: GpsStatus): GnssStatusCompat

Wraps the given GpsStatus as GnssStatusCompat.