# DensitySplit

# DensitySplit

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

<br />

```
interface DensitySplit : Split
```

<br />

*** ** * ** ***

| **This interface is deprecated.**   
| Density-based apk split feature is deprecated and will be removed in AGP 10.0.Use Android App Bundle (https://developer.android.com/guide/app-bundle)to generate optimized APKs.

DSL object for configuring per-density splits options.

See[APK Splits](https://developer.android.com/studio/build/configure-apk-splits.html).

## Summary

|                             ### Public functions                             |
|------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [compatibleScreens](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/DensitySplit#compatibleScreens(kotlin.Array))`(vararg sizes: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds a new compatible screen. |

|                                                                                    ### Public properties                                                                                    |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)`<`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>` | [compatibleScreens](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/DensitySplit#compatibleScreens()) A list of compatible screens. |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                          | [isStrict](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/DensitySplit#isStrict()) TODO: Document.                                 |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[com.android.build.api.dsl.Split](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/Split) |------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [exclude](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/Split#exclude(kotlin.Array))`(vararg excludes: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Excludes some values | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [include](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/Split#include(kotlin.Array))`(vararg includes: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Includes some values | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [reset](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/Split#reset())`()` Resets the list of included split configuration.                                                                                        | |

|                                                                                                                                                                                                                                                                                                         ### Inherited properties                                                                                                                                                                                                                                                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[com.android.build.api.dsl.Split](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/Split) |------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------| | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isEnable](https://developer.android.com/reference/tools/gradle-api/8.13/com/android/build/api/dsl/Split#isEnable()) Whether to split in this dimension. | |

## Public functions

### compatibleScreens

Added in 4.2.0  
Deprecated in 8.1.0  

```
fun compatibleScreens(vararg sizes: String): Unit
```

Adds a new compatible screen.  

## Public properties

### compatibleScreens

Added in 4.2.0  
Deprecated in 8.1.0  

```
val compatibleScreens: MutableSet<String>
```

A list of compatible screens.

This will inject a matching`<compatible-screens><screen ...>`node in the manifest. This is optional.  

### isStrict

Added in 4.2.0  
Deprecated in 8.1.0  

```
var isStrict: Boolean
```

TODO: Document.