Install Android Studio
Every lesson in this track assumes you have a working Android Studio installation and can create, run, and edit a Kotlin project. This page walks through that setup once, end to end, so every later lesson can jump straight into TrailLog's code without repeating installation steps.
Download and Install Android Studio
- Download Android Studio from the official Android Developers site — it's free, and the same installer is used on Windows, macOS, and Linux.
- Run the installer and accept the default components — it bundles the Android SDK, an emulator, and the necessary platform tools automatically.
- Android Studio is built on JetBrains' IntelliJ IDEA platform, and it ships with Kotlin support built in by default. This is worth calling out explicitly: unlike some older Java-only IDE setups that needed a separate Kotlin plugin bolted on, a fresh Android Studio install can create, compile, and debug Kotlin files the moment it finishes installing.
The SDK Manager
The Android SDK is the collection of libraries, platform APIs, and build tools your project compiles against. Android Studio's SDK Manager (Tools → SDK Manager, or the toolbar icon that looks like a small box with an arrow) lets you install and update these independently of the IDE itself. At minimum you need:
- At least one SDK Platform (for example, "Android 14.0 (UpsideDownCake)") — this is the version of the Android APIs your code compiles against.
- The latest available Android SDK Build-Tools version, which contains the compiler and packaging tools (aapt2, d8, apksigner) used to turn your code into an APK.
- The Android SDK Platform-Tools package, which includes
adb— the tool Android Studio uses under the hood to install and debug apps on a device or emulator.
Creating an Android Virtual Device (AVD)
You don't need a physical phone to build and test TrailLog. The AVD Manager (Tools → Device Manager) lets you create an emulated Android device that runs entirely on your computer:
- Open the Device Manager and choose "Create Virtual Device."
- Pick a hardware profile — a mid-range phone profile like Pixel 6 is a reasonable, well-supported default.
- Choose a system image to run on the emulator — this is a specific Android version. If it isn't downloaded yet, Android Studio downloads it for you at this step.
- Finish the wizard. Your new emulator now appears in the device dropdown at the top of the editor, ready to run any project.
Walkthrough: Creating the TrailLog Project
Now let's create the actual project we'll build throughout this entire track. On first launch, Android Studio shows a welcome screen — choose New Project.
- Select a template. Android Studio's wizard offers several starting templates, organized under "Phone and Tablet." Choose Empty Views Activity specifically. This is important: Android Studio also offers an "Empty Activity" template built on Jetpack Compose (a declarative, code-first UI toolkit). This track teaches the traditional XML-layout-plus-Kotlin approach, which is still the most widely used approach in production Android codebases today — Compose is a deliberately separate track on this site, not covered here.
-
Name the project "TrailLog." Set the package name (for example,
com.codingwithsonu.traillog), choose a save location, and — critically — set the Language dropdown to Kotlin (it may already default to Kotlin on recent Android Studio versions, but confirm it explicitly). - Choose a minimum SDK. This sets the oldest Android version TrailLog will install and run on. See the reference table below for what a few common choices mean in practice.
- Click Finish. Android Studio generates the project structure, downloads any missing Gradle dependencies, and opens the main editor once the initial Gradle sync completes.
Choosing a Minimum SDK
| Minimum SDK | What it means |
|---|---|
| API 21 (Android 5.0) | Very broad device coverage; misses out on some newer platform APIs and modern permission models introduced in later versions. |
| API 24 (Android 7.0) | A common, well-balanced default for new apps — covers the large majority of active devices while unlocking multi-window support and other mid-generation platform features. |
| API 26 (Android 8.0) | Unlocks Adaptive Icons, notification channels, and background execution limits — a good baseline if you don't need to support very old hardware. |
| API 33+ (Android 13+) | Access to the newest runtime permission models (like per-app notification permission) and privacy features, at the cost of excluding older devices entirely. |
For TrailLog throughout this track, a minimum SDK of API 24 is a sensible default — it's what we'll assume in later lessons unless a specific feature genuinely requires a newer API, in which case that lesson will call it out.
Running TrailLog for the First Time
With the project open, select your AVD from the device dropdown in the toolbar and click the green Run (play) button. Android Studio builds the project, launches the emulator if it isn't already running, installs the generated APK, and starts the app. The default "Empty Views Activity" template shows a single screen with a "Hello World!" text label — seeing that appear on the emulator confirms your whole toolchain (SDK, build tools, emulator, and Gradle) is working correctly together.