Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

GnssStatus

public final class GnssStatus
extends Object

java.lang.Object
   ↳ android.location.GnssStatus


This class represents the current state of the GNSS engine. This class is used in conjunction with the GnssStatus.Callback.

Summary

Nested classes

class GnssStatus.Callback

Used for receiving notifications when GNSS events happen. 

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_QZSS

Constellation type constant for QZSS.

int CONSTELLATION_SBAS

Constellation type constant for SBAS.

int CONSTELLATION_UNKNOWN

Unknown constellation type.

Public methods

float getAzimuthDegrees(int satIndex)

Retrieves the azimuth the satellite at the specified index.

float getCarrierFrequencyHz(int satIndex)

Gets the carrier frequency of the signal tracked.

float getCn0DbHz(int satIndex)

Retrieves the carrier-to-noise density at the antenna of the satellite at the specified index in dB-Hz.

int getConstellationType(int satIndex)

Retrieves the constellation type of the satellite at the specified index.

float getElevationDegrees(int satIndex)

Retrieves the elevation of the satellite at the specified index.

int getSatelliteCount()

Gets the total number of satellites in satellite list.

int getSvid(int satIndex)

Gets the identification number for the satellite at the specific index.

boolean hasAlmanacData(int satIndex)

Reports whether the satellite at the specified index has almanac data.

boolean hasCarrierFrequencyHz(int satIndex)

Reports whether a valid getCarrierFrequencyHz(int) is available.

boolean hasEphemerisData(int satIndex)

Reports whether the satellite at the specified index has ephemeris data.

boolean usedInFix(int satIndex)

Reports whether the satellite at the specified index was used in the calculation of the most recent position fix.

Inherited methods

Constants

CONSTELLATION_BEIDOU

added in API level 24
public static final int CONSTELLATION_BEIDOU

Constellation type constant for Beidou.

Constant Value: 5 (0x00000005)

CONSTELLATION_GALILEO

added in API level 24
public static final int CONSTELLATION_GALILEO

Constellation type constant for Galileo.

Constant Value: 6 (0x00000006)

CONSTELLATION_GLONASS

added in API level 24
public static final int CONSTELLATION_GLONASS

Constellation type constant for Glonass.

Constant Value: 3 (0x00000003)

CONSTELLATION_GPS

added in API level 24
public static final int CONSTELLATION_GPS

Constellation type constant for GPS.

Constant Value: 1 (0x00000001)

CONSTELLATION_QZSS

added in API level 24
public static final int CONSTELLATION_QZSS

Constellation type constant for QZSS.

Constant Value: 4 (0x00000004)

CONSTELLATION_SBAS

added in API level 24
public static final int CONSTELLATION_SBAS

Constellation type constant for SBAS.

Constant Value: 2 (0x00000002)

CONSTELLATION_UNKNOWN

added in API level 24
public static final int CONSTELLATION_UNKNOWN

Unknown constellation type.

Constant Value: 0 (0x00000000)

Public methods

getAzimuthDegrees

added in API level 24
public float getAzimuthDegrees (int satIndex)

Retrieves the azimuth the satellite at the specified index.

Parameters
satIndex int: the index of the satellite in the list.

Returns
float

getCarrierFrequencyHz

added in API level 26
public float getCarrierFrequencyHz (int satIndex)

Gets the carrier frequency of the signal tracked.

For example it can be the GPS central frequency for L1 = 1575.45 MHz, or L2 = 1227.60 MHz, L5 = 1176.45 MHz, varying GLO channels, etc. If the field is not set, it is the primary common use central frequency, e.g. L1 = 1575.45 MHz for GPS. For an L1, L5 receiver tracking a satellite on L1 and L5 at the same time, two measurements will be reported for this same satellite, in one all the values related to L1 will be filled, and in the other all of the values related to L5 will be filled.

The value is only available if hasCarrierFrequencyHz(int) is true.

Parameters
satIndex int: the index of the satellite in the list.

Returns
float the carrier frequency of the signal tracked in Hz.

getCn0DbHz

added in API level 24
public float getCn0DbHz (int satIndex)

Retrieves the carrier-to-noise density at the antenna of the satellite at the specified index in dB-Hz.

Parameters
satIndex int: the index of the satellite in the list.

Returns
float

getConstellationType

added in API level 24
public int getConstellationType (int satIndex)

Retrieves the constellation type of the satellite at the specified index.

Parameters
satIndex int: the index of the satellite in the list.

Returns
int

getElevationDegrees

added in API level 24
public float getElevationDegrees (int satIndex)

Retrieves the elevation of the satellite at the specified index.

Parameters
satIndex int: the index of the satellite in the list.

Returns
float

getSatelliteCount

added in API level 24
public int getSatelliteCount ()

Gets the total number of satellites in satellite list.

Returns
int

getSvid

added in API level 24
public int getSvid (int satIndex)

Gets the identification number for the satellite at the specific index.

This svid is pseudo-random number for most constellations. It is FCN & OSN number for Glonass.

The distinction is made by looking at constellation field getConstellationType(int) Expected values are in the range of:

  • GPS: 1-32
  • SBAS: 120-151, 183-192
  • GLONASS: One of: OSN, or FCN+100
    • 1-24 as the orbital slot number (OSN) (preferred, if known)
    • 93-106 as the frequency channel number (FCN) (-7 to +6) plus 100. i.e. encode FCN of -7 as 93, 0 as 100, and +6 as 106
  • QZSS: 193-200
  • Galileo: 1-36
  • Beidou: 1-37

Parameters
satIndex int: the index of the satellite in the list.

Returns
int

hasAlmanacData

added in API level 24
public boolean hasAlmanacData (int satIndex)

Reports whether the satellite at the specified index has almanac data.

Parameters
satIndex int: the index of the satellite in the list.

Returns
boolean

hasCarrierFrequencyHz

added in API level 26
public boolean hasCarrierFrequencyHz (int satIndex)

Reports whether a valid getCarrierFrequencyHz(int) is available.

Parameters
satIndex int: the index of the satellite in the list.

Returns
boolean

hasEphemerisData

added in API level 24
public boolean hasEphemerisData (int satIndex)

Reports whether the satellite at the specified index has ephemeris data.

Parameters
satIndex int: the index of the satellite in the list.

Returns
boolean

usedInFix

added in API level 24
public boolean usedInFix (int satIndex)

Reports whether the satellite at the specified index was used in the calculation of the most recent position fix.

Parameters
satIndex int: the index of the satellite in the list.

Returns
boolean