Skip to the workspace
Pebellslearn by building
The Fundamentals  ›  Lesson

Gradle — How the App Gets Built

What is and how to use Gradle? 14 minGradle is the build tool that turns an Android project into an installable app, driven by settings and build files that name the modules, SDK versions and libraries.

android / Gradle — How the App Gets Built

Explore each scene at your own pace.

01 · The rule

The rule

Gradle — How the App Gets Built

You press Run and, a few seconds later, Sprout appears on the emulator. Between those two moments, a tool compiled your code, packed your images, downloaded libraries and signed the result. That tool is Gradle, and you steer it with a few short files.

The rule

Settings names the modules; each module's build file says how to build it.

An Android project has a small set of Gradle files:

  • settings.gradle.kts — lists the modules in the project, like include(":app"), and where to download libraries from.
  • build.gradle.kts in the project root — shared plugin setup.
  • app/build.gradle.kts — the important one: how to build the app module.
  • gradle/libs.versions.toml — the version catalog, one place for library versions.
android {
    namespace = "com.example.sprout"
    compileSdk = 35
    defaultConfig {
        applicationId = "com.example.sprout"
        minSdk = 26          // oldest Android version allowed
        targetSdk = 35       // version the app is designed for
        versionCode = 3      // internal number, must go up each release
        versionName = "1.2"  // what users see
    }
}
dependencies {
    implementation(libs.androidx.activity.compose)
}

applicationId is the app's unique identity on a device and in the store. implementation(...) adds a library your code can use.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.