Workshop: Android Toolchain #
In this workshop we will introduce the toolchain for building Android: the IDE, Android Studio; the programming language, Kotlin; and the build system, Gradle. We will walk through the steps of setting up a hello-world Android project, meanwhile introducing these tools and providing pointers for further learning.
Demo code for this topic is available on GitHub.
Android Studio #
Install Android Studio #
Android Studio is the recommended IDE for building Android apps. It comes with a built-in SDK manager and emulator to help you setup a development environment. It is supported on Windows, Max, Linux, and ChromeOS. The editor experience is based on JetBrains (e.g., IntelliJ IDEA, PyCharm).
Check out the official Installing Android Studio page for recommended system requirements and installation instructions. A notable requirement is the disk space: prepare at least 20 GB of free disk space (more may be needed if you use multiple SDK versions / emulators / lots of dependencies in the project). The installation package of Android Studio is also quite large (around 1.5 GB), thus please ensure a reliable network connection during the installation process.
Always choose the latest version of Android Studio, which helps in development, debugging, and our grading process. If you have installed Android Studio before, make sure they are upgraded to the latest version; a clean reinstallation is recommended if the previous version is > 1 year old.
Setup new project #
Let’s now create a new project.
If it is the first time you are using Android Studio, there should be a pretty obvious New Project button on the welcome screen.
Otherwise (if you are already in a project), it can be done via File -> New -> New Project....
Choose the default project template Phone and Tablet, Empty Activity to proceed.
You should see the next screen asking for several important metadata:

- Name: the name of your project, usually in
CamelCasestyle. - Package name: that is a unique prefix for your codebase, usually in reversed domain name style, all lower case (avoid using underscores here).
- Save location: the directory where your project will be saved, it can be (and should be) a Git repository.
- Minimum SDK: the minimum Android SDK version that your app supports, details below…
SDK version #
Let’s first introduce the minimum SDK version following the flow of the new project setup.
The minimum SDK version (e.g., 24) decides the minimum Android OS version (e.g., 7.0 Nougat) that your app supports.
You should generally choose a relatively recent version that covers the majority of the devices (like the hint says, Your app will run on approximately 99.2% of devices, 24 is a good default version at this point).
That said, the SDK version also constraints the Android APIs/features your app can use, and sometimes you may want to set a higher minimum SDK if a core functionality of your app depends on newer APIs/features.
If you click on Help me choose, there is a mapping of SDK version - Android OS version/APIs/features that you can refer to.
Don’t worry, you can change it later.

The target SDK version (e.g., 36 is the default one provided by Android Studio as of 2026) can be different from the minimum SDK version.
You don’t get to choose it now, but you can change it later.
This is the actual SDK that got downloaded, and used during the build process, code completion, and linting.
This should usually be a recent SDK version, so that your code is based on & compatible with the latest APIs/features.
Google Play has a requirement for target SDK version of published apps to be at least 35.
Android Studio will warn you if you’re using a API/feature that is available in target SDK but higher than minimum SDK; in that case, you can (1) add an if guard to conditionally enable the feature (if the feature can be optional), or (2) raise the minimum SDK version.
After the project is created, you can find and change the two SDK versions at the app’s build configuration build.gradle.kts.
For minimum SDK, change minSdk. For target SDK, change both compileSdk and targetSdk.
You can manage the SDK versions installed by Android Studio via Tools -> SDK Manager (usually it is done automatically).
File structure #
Once you’re happy with the metadata, you can click on Finish to get the project created.
Project initialization may take a few minutes (when you see the notice “Gradle sync in progress…”), especially for the first project.
There are lots of files and directories being created…
Android Studio supports multiple views for these files. The default view, after the project initialization is done, is Android view. It shows a filtered list of the most important code files and build configurations, but note that they don’t represent the actual file system structure.

A quick explanation of what you see:
app: that is the (only) module in the project, representing the main app.manifests: contains the Android-related configuration, e.g., for declaring the app’s permissions (documentation).kotlin+java: your source code.ca.uwaterloo.cs446.helloworld…MainActivity.kt: production code, now only contains a single activity.- the same name but with
(androidTest)and(test)suffixes: test code.
res: contains the resources for the app, like strings, colors, drawings, etc.
Gradle Scripts: the build configurations for the project, where you can change SDK and add dependencies.
To check how the files are actually organized, you can switch to Project Files view.
Here you can see the actual structure of the files, where the build configurations are located at the corresponding project/module level, and the production/test code are separated in src/{main,test,androidTest} directories with the same package names.

Run the app #
The run/debug buttons can be found at the top toolbar.

There are two things that need to be selected:
- The device, either a physical phone or an emulator. Details below…
- The configuration (
app), specifying the module to run.
If you have a physical Android phone, you can use it as the debugging device. You can turn on the developer options and USB debugging on the phone, and then connect it via USB/WIFI.
Otherwise, you can use an emulator (virtual device).
If it’s the first time, you will need to install one in the Device Manager (Tools -> Device Manager, also accessible via a shortcut button on the right toolbar).
There you can select things like screen size and Android OS version.
Note that the emulator can consume quite a lot of CPU/RAM resources.
Kotlin #
Kotlin is the default programming language for modern Android development. It was designed as a drop-in replacement for Java (thus inheriting many of its grammar), but also introduces many “modern” programming language features (some of which you can find in Python/TypeScript/Rust) like string interpolation, null safety, named parameters, etc.
Kotlin has pretty official websites for documentation and tutorials.
- Kotlin documentation
- Make sure to check and follow the coding conventions.
- And check out the idioms for some code patterns that appear frequently.
- Android Developers guide on Kotlin
Most of the Kotlin grammars are more or less similar to other PLs. But here are some things that may be less intuitive at first:
- Use
valfor immutable variables aka values (by default), andvarfor mutable variables. - Explicit nullability: a big difference from Java-like language is that the variable cannot be null by default; you need to explicitly declare nullable types as
Type?. - Lambda expressions are everywhere as functions are first-class citizens; notably, if the last parameter of a function takes a function, you can use the trailing lambda syntax like the
setContent { ... }andScaffold(modifier=...) { ... }in the generatedMainActivity.kt.
Gradle #
Gradle is the build system that crunches in the background to download dependencies, compile source code, package your app into an APK, and run/debug/test it.
The build configuration files tell Gradle what to do (based on a default workflow), most importantly, specify dependencies, plugins, the SDK versions (mentioned above), and build targets (usually you don’t need to change this).
The main build configuration file is build.gradle.kts (as the extension suggests, it follows Kotlin grammar).
You will find one under the project root (usually for defining versions) and each module (specifying the configuration for that app).
Another useful file is gradle/libs.versions.toml under the project root, which unifies the version declarations for all dependencies.
The dependencies are the third-party libraries that your app depends on, such as Jetpack Compose (for UI) and JUnit (for testing) that are already included.
Dependencies declared with implementation(...) are used in production code and bundled into the APK.
Other dependencies like testImplementation(...)/androidTestImplementation(...)/debugImplementation(...) are used during testing/debugging only and not bundled into the APK.
The plugins are extensions that modify the build process.
The default ones included for Android and Jetpack Compose are required for the Android build.
There are also others that you can add as needed, such as libs.plugins.kotlin.serialization for automatically generating serializers for data classes.
Every time you change the build configuration, you will notice “Gradle sync” happening in the background to update your development environment. Be patient with it as it usually takes seconds to minutes.
Next steps #
Android Developers website has a lot of tutorials and code samples. You are ready to explore them yourself with the toolchain we introduced today. We will also cover some more Android development topics, especially the Jetpack Compose framework, in the next workshop.