# ApplicationAndroidResources

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


```
@Incubating
interface ApplicationAndroidResources : AndroidResources
```

<br />

*** ** * ** ***

Build-time properties for Android Resources inside a `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/Component`. Specialization of `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/AndroidResources` for modules that applied the `com.android.application` plugin.

This is accessed via `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/GeneratesApk#androidResources()`

## 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/variant/ApplicationAndroidResources#generateLocaleConfig()` Read-only property that automatically generates locale config when enabled. |
| `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/SetProperty.html<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/variant/ApplicationAndroidResources#localeFilters()` Specifies a list of locales that resources will be kept for. |

### Inherited properties

From [com.android.build.api.variant.AndroidResources](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/AndroidResources) `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html<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/variant/AndroidResources#aaptAdditionalParameters()`

The list of additional parameters to pass to aapt.
`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/variant/AndroidResources#dataBinding()`

Flag indicating whether databinding feature is on
`https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html<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/variant/AndroidResources#ignoreAssetsPatterns()`

The list of patterns describing assets to be ignored.
`https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html<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/variant/AndroidResources#noCompress()`

File extensions of Android resources, assets, and Java resources to be stored uncompressed in the APK.
`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/variant/AndroidResources#viewBinding()`

Flag indicating whether viewbinding feature is on

## Public properties

### generateLocaleConfig

Added in 8.4.0

```
val generateLocaleConfig: Boolean
```

Read-only property that automatically generates locale config when enabled.

To set it, use `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ApplicationAndroidResourcesBuilder#generateLocaleConfig()` in a `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/AndroidComponentsExtension#beforeVariants(com.android.build.api.variant.VariantSelector,kotlin.Function1)` callback.

### localeFilters

Added in 8.8.0

```
val localeFilters: SetProperty<String>
```

Specifies a list of locales that resources will be kept for.

For example, if you are using a library that includes locale-specific resources (such as AppCompat or Google Play Services), then your APK includes all translated language strings for the messages in those libraries whether the rest of your app is translated to the same languages or not. If you'd like to keep only the languages that your app officially supports, you can specify those languages using the `localeFilters` property, as shown in the sample below. Any resources for locales not specified are not included in the build.

```
androidComponents {
    onVariants(selector().withName("release")) { variant ->
        // Keeps language resources for the locales specified below.
        variant.androidResources.localeFilters.addAll("en-rGB", "fr")
    }
}
```

The locale must be specified either as (1) a two-letter ISO 639-1 language code, with the option to add a two-letter ISO 3166-1-alpha-2 region code preceded by "-r" (e.g. en-rUS), or (2) a BCP-47 language tag, which additionally allows you to specify a script subtag (e.g. b+sr+Latn+RS).

For more information on formulating locale qualifiers, see "Language, script (optional), and region (optional)" in the [alternative resources](https://d.android.com/r/tools/alternative-resources) table.