Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/location/GnssStatus.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/location/GnssStatus.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/location/GnssStatus.Builder#inhmethods)

# GnssStatus.Builder

*** ** * ** ***

` public static final class GnssStatus.Builder `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.location.GnssStatus.Builder |

<br />

*** ** * ** ***

Builder class to help create new GnssStatus instances.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/location/GnssStatus.Builder#Builder()() ` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/location/GnssStatus.Builder` | ` https://developer.android.com/reference/android/location/GnssStatus.Builder#addSatellite(int,%20int,%20float,%20float,%20float,%20boolean,%20boolean,%20boolean,%20boolean,%20float,%20boolean,%20float,%20boolean,%20java.lang.String,%20boolean,%20long,%20boolean,%20double)(int constellationType, int svid, float cn0DbHz, float elevation, float azimuth, boolean hasEphemeris, boolean hasAlmanac, boolean usedInFix, boolean hasCarrierFrequency, float carrierFrequency, boolean hasBasebandCn0DbHz, float basebandCn0DbHz, boolean hasCodeType, https://developer.android.com/reference/java/lang/String codeType, boolean hasElapsedRealtimeNanos, long elapsedRealtimeNanos, boolean hasElapsedRealtimeUncertaintyNanos, double elapsedRealtimeUncertaintyNanos) ` Adds a new satellite to the Builder. |
| ` https://developer.android.com/reference/android/location/GnssStatus.Builder` | ` https://developer.android.com/reference/android/location/GnssStatus.Builder#addSatellite(int,%20int,%20float,%20float,%20float,%20boolean,%20boolean,%20boolean,%20boolean,%20float,%20boolean,%20float)(int constellationType, int svid, float cn0DbHz, float elevation, float azimuth, boolean hasEphemeris, boolean hasAlmanac, boolean usedInFix, boolean hasCarrierFrequency, float carrierFrequency, boolean hasBasebandCn0DbHz, float basebandCn0DbHz) ` Adds a new satellite to the Builder. |
| ` https://developer.android.com/reference/android/location/GnssStatus` | ` https://developer.android.com/reference/android/location/GnssStatus.Builder#build()() ` Builds a new GnssStatus based on the satellite information in the Builder. |
| ` https://developer.android.com/reference/android/location/GnssStatus.Builder` | ` https://developer.android.com/reference/android/location/GnssStatus.Builder#clearSatellites()() ` Clears all satellites in the Builder. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### Builder

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder ()
```

<br />

<br />

## Public methods

### addSatellite

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public GnssStatus.Builder addSatellite (int constellationType, 
                int svid, 
                float cn0DbHz, 
                float elevation, 
                float azimuth, 
                boolean hasEphemeris, 
                boolean hasAlmanac, 
                boolean usedInFix, 
                boolean hasCarrierFrequency, 
                float carrierFrequency, 
                boolean hasBasebandCn0DbHz, 
                float basebandCn0DbHz, 
                boolean hasCodeType, 
                String codeType, 
                boolean hasElapsedRealtimeNanos, 
                long elapsedRealtimeNanos, 
                boolean hasElapsedRealtimeUncertaintyNanos, 
                double elapsedRealtimeUncertaintyNanos)
```

Adds a new satellite to the Builder.

<br />

| Parameters ||
|---|---|
| `constellationType` | `int`: one of the CONSTELLATION_\* constants. Value is one of the following: - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_UNKNOWN` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_GPS` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_SBAS` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_GLONASS` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_QZSS` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_BEIDOU` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_GALILEO` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_IRNSS` |
| `svid` | `int`: the space vehicle identifier. Value is between 1 and 200 inclusive <br /> |
| `cn0DbHz` | `float`: carrier-to-noise density at the antenna in dB-Hz. Value is between 0.0f and 63.0f inclusive <br /> |
| `elevation` | `float`: satellite elevation in degrees. Value is between -90.0f and 90.0f inclusive <br /> |
| `azimuth` | `float`: satellite azimuth in degrees. Value is between 0.0f and 360.0f inclusive <br /> |
| `hasEphemeris` | `boolean`: whether the satellite has ephemeris data <br /> |
| `hasAlmanac` | `boolean`: whether the satellite has almanac data <br /> |
| `usedInFix` | `boolean`: whether the satellite was used in the most recent location fix <br /> |
| `hasCarrierFrequency` | `boolean`: whether carrier frequency data is available <br /> |
| `carrierFrequency` | `float`: satellite carrier frequency in Hz. Value is 0.0f or greater <br /> |
| `hasBasebandCn0DbHz` | `boolean`: whether baseband carrier-to-noise density is available <br /> |
| `basebandCn0DbHz` | `float`: baseband carrier-to-noise density in dB-Hz. Value is between 0.0f and 63.0f inclusive <br /> |
| `hasCodeType` | `boolean`: whether codetype is available <br /> |
| `codeType` | `String`: the code type as defined in `https://developer.android.com/reference/android/location/GnssMeasurement#getCodeType()` This value cannot be `null`. Value is one of the following: - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_A` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_B` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_C` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_D` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_E` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_I` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_L` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_M` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_N` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_P` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_Q` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_S` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_W` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_X` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_Y` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_Z` - `https://developer.android.com/reference/android/location/GnssMeasurement#CODE_TYPE_UNKNOWN` |
| `hasElapsedRealtimeNanos` | `boolean`: whether the elapsedRealtimeNanos is available <br /> |
| `elapsedRealtimeNanos` | `long`: the elapsed real-time of this GnssStatus since system boot, in nanoseconds. Value is 0 or greater <br /> |
| `hasElapsedRealtimeUncertaintyNanos` | `boolean`: whether the elapsedRealTimeUncertanityNanos is available <br /> |
| `elapsedRealtimeUncertaintyNanos` | `double`: estimate of the relative precision of the alignment of this GnssStatus timestamp, with the reported measurements in nanoseconds (68% confidence). Value is 0.0f or greater <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/location/GnssStatus.Builder` | This value cannot be `null`. <br /> |

### addSatellite

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public GnssStatus.Builder addSatellite (int constellationType, 
                int svid, 
                float cn0DbHz, 
                float elevation, 
                float azimuth, 
                boolean hasEphemeris, 
                boolean hasAlmanac, 
                boolean usedInFix, 
                boolean hasCarrierFrequency, 
                float carrierFrequency, 
                boolean hasBasebandCn0DbHz, 
                float basebandCn0DbHz)
```

Adds a new satellite to the Builder.

<br />

| Parameters ||
|---|---|
| `constellationType` | `int`: one of the CONSTELLATION_\* constants. Value is one of the following: - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_UNKNOWN` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_GPS` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_SBAS` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_GLONASS` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_QZSS` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_BEIDOU` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_GALILEO` - `https://developer.android.com/reference/android/location/GnssStatus#CONSTELLATION_IRNSS` |
| `svid` | `int`: the space vehicle identifier. Value is between 1 and 200 inclusive <br /> |
| `cn0DbHz` | `float`: carrier-to-noise density at the antenna in dB-Hz. Value is between 0.0f and 63.0f inclusive <br /> |
| `elevation` | `float`: satellite elevation in degrees. Value is between -90.0f and 90.0f inclusive <br /> |
| `azimuth` | `float`: satellite azimuth in degrees. Value is between 0.0f and 360.0f inclusive <br /> |
| `hasEphemeris` | `boolean`: whether the satellite has ephemeris data <br /> |
| `hasAlmanac` | `boolean`: whether the satellite has almanac data <br /> |
| `usedInFix` | `boolean`: whether the satellite was used in the most recent location fix <br /> |
| `hasCarrierFrequency` | `boolean`: whether carrier frequency data is available <br /> |
| `carrierFrequency` | `float`: satellite carrier frequency in Hz. Value is 0.0f or greater <br /> |
| `hasBasebandCn0DbHz` | `boolean`: whether baseband carrier-to-noise density is available <br /> |
| `basebandCn0DbHz` | `float`: baseband carrier-to-noise density in dB-Hz. Value is between 0.0f and 63.0f inclusive <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/location/GnssStatus.Builder` | This value cannot be `null`. <br /> |

### build

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public GnssStatus build ()
```

Builds a new GnssStatus based on the satellite information in the Builder.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/location/GnssStatus` | This value cannot be `null`. <br /> |

### clearSatellites

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public GnssStatus.Builder clearSatellites ()
```

Clears all satellites in the Builder.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/location/GnssStatus.Builder` | This value cannot be `null`. <br /> |