# DataBinding

[View Source](https://cs.android.com/search?q=file:com/android/build/api/dsl/DataBinding.kt+class:com.android.build.api.dsl.DataBinding) Added in 4.2.0


```
interface DataBinding
```

<br />

*** ** * ** ***

DSL object for configuring databinding options.

## Summary

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/DataBinding#addDefaultAdapters()` Whether to add the default data binding adapters. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/DataBinding#addKtx()` Whether to add the data binding KTX features. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/DataBinding#enable()` Whether to enable data binding. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/DataBinding#enableForTests()` Whether to run data binding code generation for test projects. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/DataBinding#isEnabled()` **This property is deprecated.** deprecated, use enable |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/DataBinding#isEnabledForTests()` **This property is deprecated.** deprecated, use enableForTests |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/DataBinding#version()` The version of data binding to use. |

## Public properties

### addDefaultAdapters

Added in 4.2.0

```
var addDefaultAdapters: Boolean
```

Whether to add the default data binding adapters.

### addKtx

Added in 7.0.0

```
var addKtx: Boolean?
```

Whether to add the data binding KTX features. A null value means that the user hasn't specified any value in the DSL. The default value can be tweaked globally using the `android.defaults.databinding.addKtx` gradle property.

### enable

Added in 7.3.0

```
var enable: Boolean
```

Whether to enable data binding.

### enableForTests

Added in 7.3.0

```
var enableForTests: Boolean
```

Whether to run data binding code generation for test projects.

### isEnabled

Added in 4.2.0 Deprecated in 7.3.0

```
var isEnabled: Boolean
```

> [!CAUTION]
> **This property is deprecated.**   
> deprecated, use enable, use this instead:
>
> ```
> enable
> ```

### isEnabledForTests

Added in 4.2.0 Deprecated in 7.3.0

```
var isEnabledForTests: Boolean
```

> [!CAUTION]
> **This property is deprecated.**   
> deprecated, use enableForTests, use this instead:
>
> ```
> enableForTests
> ```

### version

Added in 4.2.0

```
var version: String?
```

The version of data binding to use.