---
# System prepended metadata

title: Android Gradle Properties
tags: [Android Gradle]

---

# Android Gradle Properties
###### tags: `Android Gradle`


![](https://i.imgur.com/eFEmGoV.png)

[TOC]

# Introduction to gradle.properties
**gradle.properties** is usually set up and new when we make a new project. This one contains some default settings like the ones below.
```java=
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
org.gradle.parallel=true
android.useAndroidX=true
// Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

```

# What can it be used for?

## Store Constants
We can save up some **key-value information** that can be **used in our build.gradle** in app or module. The values **can also be used in applied/import .gradle files** in build.gradle.

### Set Up Key-Value
>![](https://i.imgur.com/bR4yGxd.png)[color=orange]


### Apply Key-Value in Build.Gradle
>![](https://i.imgur.com/4vvnXqw.png)[color=orange]


### Check usage in BuildConfig
>![](https://i.imgur.com/KCiEyDC.png)[color=orange]


## Store Booleans 
We can use gradle.properties key-value booleans as a way to decide our if statements in build.gradle file.

**gradle.properties:**
```java=
isModule=true
```

**build.gradle:**
As example in implementations:
```java=
if (isModule.toBoolean()) {
    implementation project(':FootballLib:football')
}
```