GnssStatusCompat

Added in 1.5.0

public abstract class 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 types

public abstract class GnssStatusCompat.Callback

See GnssStatus.Callback.

Constants

static final int

Constellation type constant for Beidou.

static final int

Constellation type constant for Galileo.

static final int

Constellation type constant for Glonass.

static final int

Constellation type constant for GPS.

static final int

Constellation type constant for IRNSS.

static final int

Constellation type constant for QZSS.

static final int

Constellation type constant for SBAS.

static final int

Unknown constellation type.

Public methods

abstract @FloatRange(from = 0, to = 360) float
getAzimuthDegrees(@IntRange(from = 0) int satelliteIndex)

See getAzimuthDegrees and getAzimuth.

abstract @FloatRange(from = 0, to = 63) float
getBasebandCn0DbHz(@IntRange(from = 0) int satelliteIndex)

See getCarrierFrequencyHz.

abstract @FloatRange(from = 0) float
getCarrierFrequencyHz(@IntRange(from = 0) int satelliteIndex)

See getCarrierFrequencyHz.

abstract @FloatRange(from = 0, to = 63) float
getCn0DbHz(@IntRange(from = 0) int satelliteIndex)

See getCn0DbHz and getSnr.

abstract int
getConstellationType(@IntRange(from = 0) int satelliteIndex)

See getConstellationType.

abstract @FloatRange(from = "-90", to = 90) float
getElevationDegrees(@IntRange(from = 0) int satelliteIndex)

See getElevationDegrees and getElevation.

abstract @IntRange(from = 0) int

See getSatelliteCount and getMaxSatellites.

abstract @IntRange(from = 1, to = 200) int
getSvid(@IntRange(from = 0) int satelliteIndex)

See getSvid and getPrn.

abstract boolean
hasAlmanacData(@IntRange(from = 0) int satelliteIndex)

See hasAlmanacData and hasAlmanac.

abstract boolean
hasBasebandCn0DbHz(@IntRange(from = 0) int satelliteIndex)

See hasBasebandCn0DbHz.

abstract boolean
hasCarrierFrequencyHz(@IntRange(from = 0) int satelliteIndex)

See hasCarrierFrequencyHz.

abstract boolean
hasEphemerisData(@IntRange(from = 0) int satelliteIndex)

See hasEphemerisData and hasEphemeris.

abstract boolean
usedInFix(@IntRange(from = 0) int satelliteIndex)

See usedInFix and usedInFix.

static @NonNull GnssStatusCompat
@RequiresApi(value = VERSION_CODES.N)
wrap(@NonNull GnssStatus gnssStatus)

Wraps the given GnssStatus as GnssStatusCompat.

static @NonNull GnssStatusCompat
wrap(@NonNull GpsStatus gpsStatus)

Wraps the given GpsStatus as GnssStatusCompat.

Constants

CONSTELLATION_BEIDOU

Added in 1.5.0
public static final int CONSTELLATION_BEIDOU = 5

Constellation type constant for Beidou.

CONSTELLATION_GALILEO

Added in 1.5.0
public static final int CONSTELLATION_GALILEO = 6

Constellation type constant for Galileo.

CONSTELLATION_GLONASS

Added in 1.5.0
public static final int CONSTELLATION_GLONASS = 3

Constellation type constant for Glonass.

CONSTELLATION_GPS

Added in 1.5.0
public static final int CONSTELLATION_GPS = 1

Constellation type constant for GPS.

CONSTELLATION_IRNSS

Added in 1.5.0
public static final int CONSTELLATION_IRNSS = 7

Constellation type constant for IRNSS.

CONSTELLATION_QZSS

Added in 1.5.0
public static final int CONSTELLATION_QZSS = 4

Constellation type constant for QZSS.

CONSTELLATION_SBAS

Added in 1.5.0
public static final int CONSTELLATION_SBAS = 2

Constellation type constant for SBAS.

CONSTELLATION_UNKNOWN

Added in 1.5.0
public static final int CONSTELLATION_UNKNOWN = 0

Unknown constellation type.

Public methods

getAzimuthDegrees

Added in 1.5.0
public abstract @FloatRange(from = 0, to = 360) float getAzimuthDegrees(@IntRange(from = 0) int satelliteIndex)

See getAzimuthDegrees and getAzimuth.

Parameters
@IntRange(from = 0) int satelliteIndex

A index from zero to getSatelliteCount - 1

getBasebandCn0DbHz

Added in 1.5.0
public abstract @FloatRange(from = 0, to = 63) float getBasebandCn0DbHz(@IntRange(from = 0) int satelliteIndex)

See getCarrierFrequencyHz. Behavior is undefined if hasCarrierFrequencyHz returns false.

Parameters
@IntRange(from = 0) int satelliteIndex

A index from zero to getSatelliteCount - 1

getCarrierFrequencyHz

Added in 1.5.0
public abstract @FloatRange(from = 0) float getCarrierFrequencyHz(@IntRange(from = 0) int satelliteIndex)

See getCarrierFrequencyHz. Behavior is undefined if hasCarrierFrequencyHz returns false.

Parameters
@IntRange(from = 0) int satelliteIndex

A index from zero to getSatelliteCount - 1

getCn0DbHz

Added in 1.5.0
public abstract @FloatRange(from = 0, to = 63) float getCn0DbHz(@IntRange(from = 0) int satelliteIndex)

See getCn0DbHz and getSnr.

Parameters
@IntRange(from = 0) int satelliteIndex

A index from zero to getSatelliteCount - 1

getConstellationType

Added in 1.5.0
public abstract int getConstellationType(@IntRange(from = 0) int satelliteIndex)

See getConstellationType. Will always return a value for the GPS constellation below Android N.

Parameters
@IntRange(from = 0) int satelliteIndex

A index from zero to getSatelliteCount - 1

getElevationDegrees

Added in 1.5.0
public abstract @FloatRange(from = "-90", to = 90) float getElevationDegrees(@IntRange(from = 0) int satelliteIndex)

See getElevationDegrees and getElevation.

Parameters
@IntRange(from = 0) int satelliteIndex

A index from zero to getSatelliteCount - 1

getSatelliteCount

Added in 1.5.0
public abstract @IntRange(from = 0) int getSatelliteCount()

See getSatelliteCount and getMaxSatellites.

getSvid

Added in 1.5.0
public abstract @IntRange(from = 1, to = 200) int getSvid(@IntRange(from = 0) int satelliteIndex)

See getSvid and getPrn.

Parameters
@IntRange(from = 0) int satelliteIndex

A index from zero to getSatelliteCount - 1

hasAlmanacData

Added in 1.5.0
public abstract boolean hasAlmanacData(@IntRange(from = 0) int satelliteIndex)

See hasAlmanacData and hasAlmanac.

Parameters
@IntRange(from = 0) int satelliteIndex

A index from zero to getSatelliteCount - 1

hasBasebandCn0DbHz

Added in 1.5.0
public abstract boolean hasBasebandCn0DbHz(@IntRange(from = 0) int satelliteIndex)

See hasBasebandCn0DbHz. This will always return false prior to Android R.

Parameters
@IntRange(from = 0) int satelliteIndex

A index from zero to getSatelliteCount - 1

hasCarrierFrequencyHz

Added in 1.5.0
public abstract boolean hasCarrierFrequencyHz(@IntRange(from = 0) int satelliteIndex)

See hasCarrierFrequencyHz. This will always return false prior to Android O.

Parameters
@IntRange(from = 0) int satelliteIndex

A index from zero to getSatelliteCount - 1

hasEphemerisData

Added in 1.5.0
public abstract boolean hasEphemerisData(@IntRange(from = 0) int satelliteIndex)

See hasEphemerisData and hasEphemeris.

Parameters
@IntRange(from = 0) int satelliteIndex

A index from zero to getSatelliteCount - 1

usedInFix

Added in 1.5.0
public abstract boolean usedInFix(@IntRange(from = 0) int satelliteIndex)

See usedInFix and usedInFix.

Parameters
@IntRange(from = 0) int satelliteIndex

A index from zero to getSatelliteCount - 1

wrap

Added in 1.5.0
@RequiresApi(value = VERSION_CODES.N)
public static @NonNull GnssStatusCompat wrap(@NonNull GnssStatus gnssStatus)

Wraps the given GnssStatus as GnssStatusCompat.

wrap

Added in 1.5.0
public static @NonNull GnssStatusCompat wrap(@NonNull GpsStatus gpsStatus)

Wraps the given GpsStatus as GnssStatusCompat.