# GnssStatusCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/location/GnssStatusCompat.java+class:androidx.core.location.GnssStatusCompat) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

*** ** * ** ***


```
public abstract class GnssStatusCompat
```

<br />

*** ** * ** ***

GnssStatus representation that works across all Android versions. See `https://developer.android.com/reference/android/location/GnssStatus.html` and `https://developer.android.com/reference/android/location/GpsStatus.html`.

Note: When used to wrap `https://developer.android.com/reference/android/location/GpsStatus.html`, the best performance can be obtained by using a monotonically increasing `satelliteIndex` parameter (for instance, by using a loop from 0 to `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()`). Random access is supported but performance may suffer.

## Summary

| ### Nested types |
|---|
| `public abstract class https://developer.android.com/reference/androidx/core/location/GnssStatusCompat.Callback` See `https://developer.android.com/reference/android/location/GnssStatus.Callback.html`. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#CONSTELLATION_BEIDOU() = 5` Constellation type constant for Beidou. |
| `static final int` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#CONSTELLATION_GALILEO() = 6` Constellation type constant for Galileo. |
| `static final int` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#CONSTELLATION_GLONASS() = 3` Constellation type constant for Glonass. |
| `static final int` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#CONSTELLATION_GPS() = 1` Constellation type constant for GPS. |
| `static final int` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#CONSTELLATION_IRNSS() = 7` Constellation type constant for IRNSS. |
| `static final int` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#CONSTELLATION_QZSS() = 4` Constellation type constant for QZSS. |
| `static final int` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#CONSTELLATION_SBAS() = 2` Constellation type constant for SBAS. |
| `static final int` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#CONSTELLATION_UNKNOWN() = 0` Unknown constellation type. |

| ### Public methods |
|---|---|
| `abstract @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0, to = 360) float` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getAzimuthDegrees(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex)` See `https://developer.android.com/reference/android/location/GnssStatus.html#getAzimuthDegrees(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#getAzimuth()`. |
| `abstract @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0, to = 63) float` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getBasebandCn0DbHz(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex)` See `https://developer.android.com/reference/android/location/GnssStatus.html#getCarrierFrequencyHz(int)`. |
| `abstract @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0) float` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getCarrierFrequencyHz(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex)` See `https://developer.android.com/reference/android/location/GnssStatus.html#getCarrierFrequencyHz(int)`. |
| `abstract @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0, to = 63) float` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getCn0DbHz(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex)` See `https://developer.android.com/reference/android/location/GnssStatus.html#getCn0DbHz(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#getSnr()`. |
| `abstract int` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getConstellationType(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex)` See `https://developer.android.com/reference/android/location/GnssStatus.html#getConstellationType(int)`. |
| `abstract @https://developer.android.com/reference/androidx/annotation/FloatRange(from = "-90", to = 90) float` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getElevationDegrees(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex)` See `https://developer.android.com/reference/android/location/GnssStatus.html#getElevationDegrees(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#getElevation()`. |
| `abstract @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()()` See `https://developer.android.com/reference/android/location/GnssStatus.html#getSatelliteCount()` and `https://developer.android.com/reference/android/location/GpsStatus.html#getMaxSatellites()`. |
| `abstract @https://developer.android.com/reference/androidx/annotation/IntRange(from = 1, to = 200) int` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSvid(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex)` See `https://developer.android.com/reference/android/location/GnssStatus.html#getSvid(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#getPrn()`. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#hasAlmanacData(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex)` See `https://developer.android.com/reference/android/location/GnssStatus.html#hasAlmanacData(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#hasAlmanac()`. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#hasBasebandCn0DbHz(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex)` See `https://developer.android.com/reference/android/location/GnssStatus.html#hasBasebandCn0DbHz(int)`. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#hasCarrierFrequencyHz(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex)` See `https://developer.android.com/reference/android/location/GnssStatus.html#hasCarrierFrequencyHz(int)`. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#hasEphemerisData(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex)` See `https://developer.android.com/reference/android/location/GnssStatus.html#hasEphemerisData(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#hasEphemeris()`. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#usedInFix(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex)` See `https://developer.android.com/reference/android/location/GnssStatus.html#usedInFix(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#usedInFix()`. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/location/GnssStatusCompat` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = https://developer.android.com/reference/android/os/VERSION_CODES.html#N) https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#wrap(android.location.GnssStatus)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/location/GnssStatus.html gnssStatus)` Wraps the given `https://developer.android.com/reference/android/location/GnssStatus.html` as GnssStatusCompat. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/location/GnssStatusCompat` | `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#wrap(android.location.GpsStatus)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/location/GpsStatus.html gpsStatus)` Wraps the given `https://developer.android.com/reference/android/location/GpsStatus.html` as GnssStatusCompat. |

## Constants

### CONSTELLATION_BEIDOU

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public static final int CONSTELLATION_BEIDOU = 5
```

Constellation type constant for Beidou.

### CONSTELLATION_GALILEO

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public static final int CONSTELLATION_GALILEO = 6
```

Constellation type constant for Galileo.

### CONSTELLATION_GLONASS

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public static final int CONSTELLATION_GLONASS = 3
```

Constellation type constant for Glonass.

### CONSTELLATION_GPS

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public static final int CONSTELLATION_GPS = 1
```

Constellation type constant for GPS.

### CONSTELLATION_IRNSS

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public static final int CONSTELLATION_IRNSS = 7
```

Constellation type constant for IRNSS.

### CONSTELLATION_QZSS

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public static final int CONSTELLATION_QZSS = 4
```

Constellation type constant for QZSS.

### CONSTELLATION_SBAS

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public static final int CONSTELLATION_SBAS = 2
```

Constellation type constant for SBAS.

### CONSTELLATION_UNKNOWN

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public static final int CONSTELLATION_UNKNOWN = 0
```

Unknown constellation type.

## Public methods

### getAzimuthDegrees

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

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

See `https://developer.android.com/reference/android/location/GnssStatus.html#getAzimuthDegrees(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#getAzimuth()`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex` | A index from zero to `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()` - 1 |

### getBasebandCn0DbHz

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

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

See `https://developer.android.com/reference/android/location/GnssStatus.html#getCarrierFrequencyHz(int)`. Behavior is undefined if `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#hasCarrierFrequencyHz(int)` returns false.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex` | A index from zero to `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()` - 1 |

### getCarrierFrequencyHz

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

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

See `https://developer.android.com/reference/android/location/GnssStatus.html#getCarrierFrequencyHz(int)`. Behavior is undefined if `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#hasCarrierFrequencyHz(int)` returns false.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex` | A index from zero to `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()` - 1 |

### getCn0DbHz

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

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

See `https://developer.android.com/reference/android/location/GnssStatus.html#getCn0DbHz(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#getSnr()`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex` | A index from zero to `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()` - 1 |

### getConstellationType

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

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

See `https://developer.android.com/reference/android/location/GnssStatus.html#getConstellationType(int)`. Will always return a value for the GPS constellation below Android N.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex` | A index from zero to `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()` - 1 |

### getElevationDegrees

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

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

See `https://developer.android.com/reference/android/location/GnssStatus.html#getElevationDegrees(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#getElevation()`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex` | A index from zero to `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()` - 1 |

### getSatelliteCount

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public abstract @IntRange(from = 0) int getSatelliteCount()
```

See `https://developer.android.com/reference/android/location/GnssStatus.html#getSatelliteCount()` and `https://developer.android.com/reference/android/location/GpsStatus.html#getMaxSatellites()`.

### getSvid

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

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

See `https://developer.android.com/reference/android/location/GnssStatus.html#getSvid(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#getPrn()`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex` | A index from zero to `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()` - 1 |

### hasAlmanacData

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

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

See `https://developer.android.com/reference/android/location/GnssStatus.html#hasAlmanacData(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#hasAlmanac()`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex` | A index from zero to `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()` - 1 |

### hasBasebandCn0DbHz

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

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

See `https://developer.android.com/reference/android/location/GnssStatus.html#hasBasebandCn0DbHz(int)`. This will always return false prior to Android R.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex` | A index from zero to `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()` - 1 |

### hasCarrierFrequencyHz

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

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

See `https://developer.android.com/reference/android/location/GnssStatus.html#hasCarrierFrequencyHz(int)`. This will always return false prior to Android O.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex` | A index from zero to `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()` - 1 |

### hasEphemerisData

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

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

See `https://developer.android.com/reference/android/location/GnssStatus.html#hasEphemerisData(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#hasEphemeris()`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex` | A index from zero to `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()` - 1 |

### usedInFix

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

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

See `https://developer.android.com/reference/android/location/GnssStatus.html#usedInFix(int)` and `https://developer.android.com/reference/android/location/GpsSatellite.html#usedInFix()`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int satelliteIndex` | A index from zero to `https://developer.android.com/reference/androidx/core/location/GnssStatusCompat#getSatelliteCount()` - 1 |

### wrap

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

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

Wraps the given `https://developer.android.com/reference/android/location/GnssStatus.html` as GnssStatusCompat.

### wrap

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public static @NonNull GnssStatusCompat wrap(@NonNull GpsStatus gpsStatus)
```

Wraps the given `https://developer.android.com/reference/android/location/GpsStatus.html` as GnssStatusCompat.