# GnssStatusBuilder

Summary:[Constants](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#constants)\|[Ctors](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#pubctors)\|[Methods](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#)  

# GnssStatusBuilder

`
public

final

class
GnssStatusBuilder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|-----------------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | com.google.android.things.userdriver.location.GnssStatusBuilder |

<br />

*** ** * ** ***

Builder for[GnssStatus](https://developer.android.com/reference/android/location/GnssStatus.html), which contains information about satellites that were detected.

## Summary

|                                                                                                                                       ### Constants                                                                                                                                        ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [GNSS_SV_FLAGS_HAS_ALMANAC_DATA](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#GNSS_SV_FLAGS_HAS_ALMANAC_DATA) Flag to indicate that the satellite at a specific index has almanac data.                                  |
| `int` | [GNSS_SV_FLAGS_HAS_CARRIER_FREQUENCY](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#GNSS_SV_FLAGS_HAS_CARRIER_FREQUENCY) Flag to indicate that the satellite at a specific index has valid carrier frequency data.        |
| `int` | [GNSS_SV_FLAGS_HAS_EPHEMERIS_DATA](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#GNSS_SV_FLAGS_HAS_EPHEMERIS_DATA) Flag to indicate that the satellite at a specific index has ephemeris data.                            |
| `int` | [GNSS_SV_FLAGS_NONE](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#GNSS_SV_FLAGS_NONE) No flags.                                                                                                                          |
| `int` | [GNSS_SV_FLAGS_USED_IN_FIX](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#GNSS_SV_FLAGS_USED_IN_FIX) Flag to indicate that the satellite at a specific index was used in the calculation of the most recent position fix. |

|                                                                                    ### Public constructors                                                                                    ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#GnssStatusBuilder(int))`(int satelliteCount) ` Constructor. |

|                                                                                                                                                                                       ### Public methods                                                                                                                                                                                       ||
|---------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[GnssStatus](https://developer.android.com/reference/android/location/GnssStatus.html)                                       | ` `[build](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#build())`() ` Build a GnssStatus from the set data.                                                                                        |
| ` `[GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | ` `[setAzimuth](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#setAzimuth(int, float))`(int satelliteIndex, float azimuth) ` Sets the azimuth of one satellite.                                      |
| ` `[GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | ` `[setCarrierFrequency](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#setCarrierFrequency(int, float))`(int satelliteIndex, float carrierFrequency) ` Sets the carrier frequency of one satellite. |
| ` `[GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | ` `[setCn0DbHz](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#setCn0DbHz(int, float))`(int satelliteIndex, float cn0Db) ` Sets the carrier-to-noise density for one satellite.                      |
| ` `[GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | ` `[setConstellation](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#setConstellation(int, int))`(int satelliteIndex, int constellation) ` Sets the constellation for one satellite.                 |
| ` `[GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | ` `[setElevation](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#setElevation(int, float))`(int satelliteIndex, float elevation) ` Sets the elevation of one satellite.                              |
| ` `[GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | ` `[setFlags](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#setFlags(int, int))`(int satelliteIndex, int flags) ` Sets the flags for one satellite.                                                 |
| ` `[GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | ` `[setSvid](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#setSvid(int, int))`(int satelliteIndex, int svid) ` Sets the identification number for one satellite.                                    |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder#)From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                                                                                                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                                                                                                                                                                                                                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                                                                                                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                                                                                                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                                                                                                                                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                                                                                                                                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                                                                                                                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long, int))`(long millis, int nanos) ` Causes the current thread to wait until another thread invokes the[notify()](https://developer.android.com/reference/java/lang/Object.html#notify())method or the[notifyAll()](https://developer.android.com/reference/java/lang/Object.html#notifyAll())method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long millis) ` Causes the current thread to wait until either another thread invokes the[notify()](https://developer.android.com/reference/java/lang/Object.html#notify())method or the[notifyAll()](https://developer.android.com/reference/java/lang/Object.html#notifyAll())method for this object, or a specified amount of time has elapsed.                                                                 | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until another thread invokes the[notify()](https://developer.android.com/reference/java/lang/Object.html#notify())method or the[notifyAll()](https://developer.android.com/reference/java/lang/Object.html#notifyAll())method for this object.                                                                                                                                  | ||

## Constants

### GNSS_SV_FLAGS_HAS_ALMANAC_DATA

```
int GNSS_SV_FLAGS_HAS_ALMANAC_DATA
```

Flag to indicate that the satellite at a specific index has almanac data.

<br />

Constant Value: 2 (0x00000002)  

### GNSS_SV_FLAGS_HAS_CARRIER_FREQUENCY

```
int GNSS_SV_FLAGS_HAS_CARRIER_FREQUENCY
```

Flag to indicate that the satellite at a specific index has valid carrier frequency data.

<br />

Constant Value: 8 (0x00000008)  

### GNSS_SV_FLAGS_HAS_EPHEMERIS_DATA

```
int GNSS_SV_FLAGS_HAS_EPHEMERIS_DATA
```

Flag to indicate that the satellite at a specific index has ephemeris data.

<br />

Constant Value: 1 (0x00000001)  

### GNSS_SV_FLAGS_NONE

```
int GNSS_SV_FLAGS_NONE
```

No flags.

<br />

Constant Value: 0 (0x00000000)  

### GNSS_SV_FLAGS_USED_IN_FIX

```
int GNSS_SV_FLAGS_USED_IN_FIX
```

Flag to indicate that the satellite at a specific index was used in the calculation of the most recent position fix.

<br />

Constant Value: 4 (0x00000004)

## Public constructors

### GnssStatusBuilder

```
GnssStatusBuilder (int satelliteCount)
```

Constructor.

<br />

|                                       Parameters                                        ||
|------------------|-----------------------------------------------------------------------|
| `satelliteCount` | `int`: the number of satellites this status contains data from <br /> |

## Public methods

### build

```
GnssStatus build ()
```

Build a GnssStatus from the set data.

<br />

|                                                                          Returns                                                                          ||
|----------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| [GnssStatus](https://developer.android.com/reference/android/location/GnssStatus.html) | A new GnssStatus with the parameters set for this builder. <br /> |

### setAzimuth

```
GnssStatusBuilder setAzimuth (int satelliteIndex, 
                float azimuth)
```

Sets the azimuth of one satellite.

<br />

|                                     Parameters                                      ||
|------------------|-------------------------------------------------------------------|
| `satelliteIndex` | `int`: the index of the satellite to set the azimuth of <br />    |
| `azimuth`        | `float`: the azimuth to set for that satellite, in degrees <br /> |

|                                                               Returns                                                                ||
|------------------------------------------------------------------------------------------------------------------------------|--------|
| [GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | <br /> |

### setCarrierFrequency

```
GnssStatusBuilder setCarrierFrequency (int satelliteIndex, 
                float carrierFrequency)
```

Sets the carrier frequency of one satellite.

<br />

|                                          Parameters                                          ||
|--------------------|--------------------------------------------------------------------------|
| `satelliteIndex`   | `int`: the index of the satellite to set the carrier frequency of <br /> |
| `carrierFrequency` | `float`: the carrier frequency to set for that satellite, in Hz <br />   |

|                                                               Returns                                                                ||
|------------------------------------------------------------------------------------------------------------------------------|--------|
| [GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | <br /> |

### setCn0DbHz

```
GnssStatusBuilder setCn0DbHz (int satelliteIndex, 
                float cn0Db)
```

Sets the carrier-to-noise density for one satellite.

<br />

|                                                    Parameters                                                     ||
|------------------|-------------------------------------------------------------------------------------------------|
| `satelliteIndex` | `int`: the index of the satellite to set the carrier-to-noise density of <br />                 |
| `cn0Db`          | `float`: the carrier-to-noise density at the antenna to set for that satellite, in dB-Hz <br /> |

|                                                               Returns                                                                ||
|------------------------------------------------------------------------------------------------------------------------------|--------|
| [GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | <br /> |

### setConstellation

```
GnssStatusBuilder setConstellation (int satelliteIndex, 
                int constellation)
```

Sets the constellation for one satellite.

<br />

|                                                                                     Parameters                                                                                     ||
|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `satelliteIndex` | `int`: the index of the satellite to set the constellation of <br />                                                                                             |
| `constellation`  | `int`: the constellation of that satellite. Use constellations from[GnssStatus](https://developer.android.com/reference/android/location/GnssStatus.html) <br /> |

|                                                               Returns                                                                ||
|------------------------------------------------------------------------------------------------------------------------------|--------|
| [GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | <br /> |

### setElevation

```
GnssStatusBuilder setElevation (int satelliteIndex, 
                float elevation)
```

Sets the elevation of one satellite.

<br />

|                                      Parameters                                       ||
|------------------|---------------------------------------------------------------------|
| `satelliteIndex` | `int`: the index of the satellite to set the elevation of <br />    |
| `elevation`      | `float`: the elevation to set for that satellite, in degrees <br /> |

|                                                               Returns                                                                ||
|------------------------------------------------------------------------------------------------------------------------------|--------|
| [GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | <br /> |

### setFlags

```
GnssStatusBuilder setFlags (int satelliteIndex, 
                int flags)
```

Sets the flags for one satellite.

<br />

|                                             Parameters                                              ||
|------------------|-----------------------------------------------------------------------------------|
| `satelliteIndex` | `int`: the index of the satellite to set the flags of <br />                      |
| `flags`          | `int`: a bitmask of GNSS_SV_FLAGS_\* flags describing the satellite's data <br /> |

|                                                               Returns                                                                ||
|------------------------------------------------------------------------------------------------------------------------------|--------|
| [GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | <br /> |

### setSvid

```
GnssStatusBuilder setSvid (int satelliteIndex, 
                int svid)
```

Sets the identification number for one satellite.

<br />

|                                           Parameters                                           ||
|------------------|------------------------------------------------------------------------------|
| `satelliteIndex` | `int`: the index of the satellite to set the identification number of <br /> |
| `svid`           | `int`: the identification number of that satellite <br />                    |

|                                                               Returns                                                                ||
|------------------------------------------------------------------------------------------------------------------------------|--------|
| [GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder) | <br /> |

-

  ## Interfaces

  - [GnssStateListener](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStateListener)
-

  ## Classes

  - [GnssClockBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssClockBuilder)
  - [GnssDriver](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssDriver)
  - [GnssMeasurementBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssMeasurementBuilder)
  - [GnssMeasurementsEventBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssMeasurementsEventBuilder)
  - [GnssStatusBuilder](https://developer.android.com/reference/com/google/android/things/userdriver/location/GnssStatusBuilder)