Most visited

Recently visited

Added in API level 24

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 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 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

From class java.lang.Object

Constants

CONSTELLATION_BEIDOU

Added in API level 24
int CONSTELLATION_BEIDOU

Constellation type constant for Beidou.

Constant Value: 5 (0x00000005)

CONSTELLATION_GALILEO

Added in API level 24
int CONSTELLATION_GALILEO

Constellation type constant for Galileo.

Constant Value: 6 (0x00000006)

CONSTELLATION_GLONASS

Added in API level 24
int CONSTELLATION_GLONASS

Constellation type constant for Glonass.

Constant Value: 3 (0x00000003)

CONSTELLATION_GPS

Added in API level 24
int CONSTELLATION_GPS

Constellation type constant for GPS.

Constant Value: 1 (0x00000001)

CONSTELLATION_QZSS

Added in API level 24
int CONSTELLATION_QZSS

Constellation type constant for QZSS.

Constant Value: 4 (0x00000004)

CONSTELLATION_SBAS

Added in API level 24
int CONSTELLATION_SBAS

Constellation type constant for SBAS.

Constant Value: 2 (0x00000002)

CONSTELLATION_UNKNOWN

Added in API level 24
int CONSTELLATION_UNKNOWN

Unknown constellation type.

Constant Value: 0 (0x00000000)

Public methods

getAzimuthDegrees

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

getCn0DbHz

Added in API level 24
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
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
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
int getSatelliteCount ()

Gets the total number of satellites in satellite list.

Returns
int

getSvid

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

hasEphemerisData

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

Hooray!