# ProviderProperties.Builder

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

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/location/provider/ProviderProperties.Builder "View this page in Java")  

```
class Builder
```

|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                               ||
| ↳ | [android.location.provider.ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) |

Builder for ProviderProperties.

## Summary

|                                                                                                                                                     Public constructors                                                                                                                                                     ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#Builder())`()` <br />                                                                                                                                                                                      |
| [Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#Builder(android.location.provider.ProviderProperties))`(`providerProperties:` `[ProviderProperties](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties)`)` <br /> |

|                                                                                                                                                                                                                                  Public methods                                                                                                                                                                                                                                  ||
|------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ProviderProperties](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties)                  | [build](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#build())`()` Builds a new ProviderProperties.                                                                                                                                                                                    |
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | [setAccuracy](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#setAccuracy(kotlin.Int))`(`accuracy:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets a very rough bucket of provider location accuracy.                                               |
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | [setHasAltitudeSupport](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#setHasAltitudeSupport(kotlin.Boolean))`(`supportsAltitude:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets whether a provider can provide altitude information.     |
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | [setHasBearingSupport](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#setHasBearingSupport(kotlin.Boolean))`(`supportsBearing:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets whether a provider can provide bearing information.         |
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | [setHasCellRequirement](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#setHasCellRequirement(kotlin.Boolean))`(`requiresCell:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets whether a provider requires cell tower access.               |
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | [setHasMonetaryCost](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#setHasMonetaryCost(kotlin.Boolean))`(`monetaryCost:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets whether a provider has a monetary cost.                            |
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | [setHasNetworkRequirement](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#setHasNetworkRequirement(kotlin.Boolean))`(`requiresNetwork:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets whether a provider requires network access.         |
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | [setHasSatelliteRequirement](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#setHasSatelliteRequirement(kotlin.Boolean))`(`requiresSatellite:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets whether a provider requires satellite access. |
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | [setHasSpeedSupport](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#setHasSpeedSupport(kotlin.Boolean))`(`supportsSpeed:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets whether a provider can provide speed information.                 |
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | [setPowerUsage](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#setPowerUsage(kotlin.Int))`(`powerUsage:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets a very rough bucket of provider power usage.                                               |

## Public constructors

### Builder

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

```
Builder()
```  

### Builder

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

```
Builder(providerProperties: ProviderProperties)
```

|                                                                             Parameters                                                                              ||
|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| `providerProperties` | [ProviderProperties](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties):This value cannot be`null`. |

## Public methods

### build

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

```
fun build(): ProviderProperties
```

Builds a new ProviderProperties.

|                                                                     Return                                                                     ||
|-------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ProviderProperties](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties) | This value cannot be`null`. |

### setAccuracy

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

```
fun setAccuracy(accuracy: Int): ProviderProperties.Builder
```

Sets a very rough bucket of provider location accuracy.[ACCURACY_COARSE](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties#ACCURACY_COARSE:kotlin.Int)by default.

|                                                                                                                                                                                                                                 Parameters                                                                                                                                                                                                                                  ||
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `accuracy` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.location.provider.ProviderProperties#ACCURACY_FINE](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties#ACCURACY_FINE:kotlin.Int), or[android.location.provider.ProviderProperties#ACCURACY_COARSE](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties#ACCURACY_COARSE:kotlin.Int) |

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | This value cannot be`null`. |

### setHasAltitudeSupport

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

```
fun setHasAltitudeSupport(supportsAltitude: Boolean): ProviderProperties.Builder
```

Sets whether a provider can provide altitude information. False by default.

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | This value cannot be`null`. |

### setHasBearingSupport

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

```
fun setHasBearingSupport(supportsBearing: Boolean): ProviderProperties.Builder
```

Sets whether a provider can provide bearing information. False by default.

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | This value cannot be`null`. |

### setHasCellRequirement

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

```
fun setHasCellRequirement(requiresCell: Boolean): ProviderProperties.Builder
```

Sets whether a provider requires cell tower access. False by default.

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | This value cannot be`null`. |

### setHasMonetaryCost

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

```
fun setHasMonetaryCost(monetaryCost: Boolean): ProviderProperties.Builder
```

Sets whether a provider has a monetary cost. False by default.

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | This value cannot be`null`. |

### setHasNetworkRequirement

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

```
fun setHasNetworkRequirement(requiresNetwork: Boolean): ProviderProperties.Builder
```

Sets whether a provider requires network access. False by default.

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | This value cannot be`null`. |

### setHasSatelliteRequirement

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

```
fun setHasSatelliteRequirement(requiresSatellite: Boolean): ProviderProperties.Builder
```

Sets whether a provider requires satellite access. False by default.

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | This value cannot be`null`. |

### setHasSpeedSupport

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

```
fun setHasSpeedSupport(supportsSpeed: Boolean): ProviderProperties.Builder
```

Sets whether a provider can provide speed information. False by default.

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | This value cannot be`null`. |

### setPowerUsage

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

```
fun setPowerUsage(powerUsage: Int): ProviderProperties.Builder
```

Sets a very rough bucket of provider power usage.[POWER_USAGE_HIGH](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties#POWER_USAGE_HIGH:kotlin.Int)by default.

|                                                                                                                                                                                                                                                                                                                                    Parameters                                                                                                                                                                                                                                                                                                                                    ||
|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `powerUsage` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is[android.location.provider.ProviderProperties#POWER_USAGE_LOW](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties#POWER_USAGE_LOW:kotlin.Int),[android.location.provider.ProviderProperties#POWER_USAGE_MEDIUM](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties#POWER_USAGE_MEDIUM:kotlin.Int), or[android.location.provider.ProviderProperties#POWER_USAGE_HIGH](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties#POWER_USAGE_HIGH:kotlin.Int) |

|                                                                             Return                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ProviderProperties.Builder](https://developer.android.com/reference/kotlin/android/location/provider/ProviderProperties.Builder#) | This value cannot be`null`. |