# DataNotificationConfig.Builder

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

# Builder

*** ** * ** ***

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

```
class Builder
```

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

Builder for [DataNotificationConfig](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig)

## Summary

|                                                       Public constructors                                                        ||
|-------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig.Builder#Builder())`()` <br /> |

|                                                                                                                                                                                                             Public methods                                                                                                                                                                                                             ||
|----------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DataNotificationConfig](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig)                  | [build](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig.Builder#build())`()` Builds a new instance of [DataNotificationConfig](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig).                                         |
| [DataNotificationConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig.Builder#) | [setNotificationConfigType](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig.Builder#setNotificationConfigType(kotlin.Int))`(`config:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the notification configuration type. |
| [DataNotificationConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig.Builder#) | [setProximityFarCm](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig.Builder#setProximityFarCm(kotlin.Int))`(`proximityCm:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the far proximity threshold in centimeters.     |
| [DataNotificationConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig.Builder#) | [setProximityNearCm](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig.Builder#setProximityNearCm(kotlin.Int))`(`proximityCm:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the near proximity threshold in centimeters.  |

## Public constructors

### Builder

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

```
Builder()
```

## Public methods

### build

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

```
fun build(): DataNotificationConfig
```

Builds a new instance of [DataNotificationConfig](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig).

|                                                                                                                                                            Return                                                                                                                                                            ||
|-----------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DataNotificationConfig](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig) | a new [DataNotificationConfig](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig) instance created using the current state of the builder. This value cannot be `null`. |

### setNotificationConfigType

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

```
fun setNotificationConfigType(config: Int): DataNotificationConfig.Builder
```

Sets the notification configuration type.

defaults to android.ranging.DataNotificationConfig.NotificationConfigType#NOTIFICATION_CONFIG_ENABLE

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ||
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `config` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The notification configuration type to set. Value is [android.ranging.DataNotificationConfig#NOTIFICATION_CONFIG_DISABLE](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig#NOTIFICATION_CONFIG_DISABLE:kotlin.Int), [android.ranging.DataNotificationConfig#NOTIFICATION_CONFIG_ENABLE](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig#NOTIFICATION_CONFIG_ENABLE:kotlin.Int), [android.ranging.DataNotificationConfig#NOTIFICATION_CONFIG_PROXIMITY_LEVEL](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig#NOTIFICATION_CONFIG_PROXIMITY_LEVEL:kotlin.Int), or [android.ranging.DataNotificationConfig#NOTIFICATION_CONFIG_PROXIMITY_EDGE](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig#NOTIFICATION_CONFIG_PROXIMITY_EDGE:kotlin.Int) |

|                                                                                        Return                                                                                         ||
|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| [DataNotificationConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig.Builder#) | this Builder instance. This value cannot be `null`. |

### setProximityFarCm

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

```
fun setProximityFarCm(proximityCm: Int): DataNotificationConfig.Builder
```

Sets the far proximity threshold in centimeters.

defaults to 20000 cm.

|                                                                                 Parameters                                                                                  ||
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `proximityCm` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The far proximity to set, in centimeters. Value is between 0 and 20000 inclusive |

|                                                                                        Return                                                                                         ||
|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| [DataNotificationConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig.Builder#) | this Builder instance. This value cannot be `null`. |

### setProximityNearCm

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

```
fun setProximityNearCm(proximityCm: Int): DataNotificationConfig.Builder
```

Sets the near proximity threshold in centimeters.

defaults to 0 cm.

|                                                                                  Parameters                                                                                  ||
|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `proximityCm` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The near proximity to set, in centimeters. Value is between 0 and 20000 inclusive |

|                                                                                        Return                                                                                         ||
|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| [DataNotificationConfig.Builder](https://developer.android.com/reference/kotlin/android/ranging/DataNotificationConfig.Builder#) | this Builder instance. This value cannot be `null`. |