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 |
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 |
abstract
float
|
getBasebandCn0DbHz(int satelliteIndex)
|
abstract
float
|
getCarrierFrequencyHz(int satelliteIndex)
|
abstract
float
|
getCn0DbHz(int satelliteIndex)
|
abstract
int
|
getConstellationType(int satelliteIndex)
|
abstract
float
|
getElevationDegrees(int satelliteIndex)
See |
abstract
int
|
getSatelliteCount()
See |
abstract
int
|
getSvid(int satelliteIndex)
|
abstract
boolean
|
hasAlmanacData(int satelliteIndex)
See |
abstract
boolean
|
hasBasebandCn0DbHz(int satelliteIndex)
|
abstract
boolean
|
hasCarrierFrequencyHz(int satelliteIndex)
|
abstract
boolean
|
hasEphemerisData(int satelliteIndex)
See |
abstract
boolean
|
usedInFix(int satelliteIndex)
|
static
GnssStatusCompat
|
wrap(GpsStatus gpsStatus)
Wraps the given |
static
GnssStatusCompat
|
wrap(GnssStatus gnssStatus)
Wraps the given |
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. |
getBasebandCn0DbHz
public abstract float getBasebandCn0DbHz (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 between 0.0 and 63.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 |
hasBasebandCn0DbHz
public abstract boolean hasBasebandCn0DbHz (int satelliteIndex)
See GnssStatus.hasBasebandCn0DbHz(int)
. This will always return false prior to
Android R.
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 |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-02-24 UTC.