Google berkomitmen untuk mendorong terwujudnya keadilan rasial bagi komunitas Kulit Hitam. Lihat caranya.

GnssStatusCompat

public abstract class GnssStatusCompat
extends Object

java.lang.Object
   ↳ 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

class GnssStatusCompat.Callback

See GnssStatus.Callback

Constants

int CONSTELLATION_BEIDOU

Constellation type constant for Beidou.

int CONSTELLATION_GALILEO

Constellation type constant for Galileo.

int CONSTELLATION_GLONASS

Constellation type constant for Glonass.

int CONSTELLATION_GPS

Constellation type constant for GPS.

int CONSTELLATION_IRNSS

Constellation type constant for IRNSS.

int CONSTELLATION_QZSS

Constellation type constant for QZSS.

int CONSTELLATION_SBAS

Constellation type constant for SBAS.

int CONSTELLATION_UNKNOWN

Unknown constellation type.

Public methods

abstract float getAzimuthDegrees(int satelliteIndex)

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

abstract float getCarrierFrequencyHz(int satelliteIndex)

See GnssStatus.getCarrierFrequencyHz(int).

abstract float getCn0DbHz(int satelliteIndex)

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

abstract int getConstellationType(int satelliteIndex)

See GnssStatus.getConstellationType(int).

abstract float getElevationDegrees(int satelliteIndex)

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

abstract int getSatelliteCount()

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

abstract int getSvid(int satelliteIndex)

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

abstract boolean hasAlmanacData(int satelliteIndex)

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

abstract boolean hasCarrierFrequencyHz(int satelliteIndex)

See GnssStatus.hasCarrierFrequencyHz(int).

abstract boolean hasEphemerisData(int satelliteIndex)

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

abstract boolean usedInFix(int satelliteIndex)

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

static GnssStatusCompat wrap(GpsStatus gpsStatus)

Wraps the given GpsStatus as GnssStatusCompat.

static GnssStatusCompat wrap(GnssStatus gnssStatus)

Wraps the given GnssStatus as GnssStatusCompat.

Inherited methods

Constants

CONSTELLATION_BEIDOU

public static final int CONSTELLATION_BEIDOU

Constellation type constant for Beidou.

Constant Value: 5 (0x00000005)

CONSTELLATION_GALILEO

public static final int CONSTELLATION_GALILEO

Constellation type constant for Galileo.

Constant Value: 6 (0x00000006)

CONSTELLATION_GLONASS

public static final int CONSTELLATION_GLONASS

Constellation type constant for Glonass.

Constant Value: 3 (0x00000003)

CONSTELLATION_GPS

public static final int CONSTELLATION_GPS

Constellation type constant for GPS.

Constant Value: 1 (0x00000001)

CONSTELLATION_IRNSS

public static final int CONSTELLATION_IRNSS

Constellation type constant for IRNSS.

Constant Value: 7 (0x00000007)

CONSTELLATION_QZSS

public static final int CONSTELLATION_QZSS

Constellation type constant for QZSS.

Constant Value: 4 (0x00000004)

CONSTELLATION_SBAS

public static final int CONSTELLATION_SBAS

Constellation type constant for SBAS.

Constant Value: 2 (0x00000002)

CONSTELLATION_UNKNOWN

public static final int CONSTELLATION_UNKNOWN

Unknown constellation type.

Constant Value: 0 (0x00000000)

Public methods

getAzimuthDegrees

public abstract float getAzimuthDegrees (int satelliteIndex)

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

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

Returns
float

Value is between 0.0 and 360.0 inclusive.

getCarrierFrequencyHz

public abstract float getCarrierFrequencyHz (int satelliteIndex)

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

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

Returns
float

Value is 0.0 or greater.

getCn0DbHz

public abstract float getCn0DbHz (int satelliteIndex)

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

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

Returns
float

Value is between 0.0 and 63.0 inclusive.

getConstellationType

public abstract int getConstellationType (int satelliteIndex)

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

Returns
int

getElevationDegrees

public abstract float getElevationDegrees (int satelliteIndex)

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

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

Returns
float

Value is between -90.0 and 90.0 inclusive.

getSatelliteCount

public abstract int getSatelliteCount ()

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

Returns
int

getSvid

public abstract int getSvid (int satelliteIndex)

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

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

Returns
int

Value is between 1 and 200 inclusive.

hasAlmanacData

public abstract boolean hasAlmanacData (int satelliteIndex)

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

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

Returns
boolean

hasCarrierFrequencyHz

public abstract boolean hasCarrierFrequencyHz (int satelliteIndex)

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

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

Returns
boolean

hasEphemerisData

public abstract boolean hasEphemerisData (int satelliteIndex)

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

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

Returns
boolean

usedInFix

public abstract boolean usedInFix (int satelliteIndex)

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

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

Returns
boolean

wrap

public static GnssStatusCompat wrap (GpsStatus gpsStatus)

Wraps the given GpsStatus as GnssStatusCompat.

Parameters
gpsStatus GpsStatus

Returns
GnssStatusCompat

wrap

public static GnssStatusCompat wrap (GnssStatus gnssStatus)

Wraps the given GnssStatus as GnssStatusCompat.

Parameters
gnssStatus GnssStatus

Returns
GnssStatusCompat