Android & Kotlin

Powering the
Handheld World.

Android is a mobile operating system based on a modified version of the Linux kernel, designed primarily for touchscreen mobile devices. With over 3 billion active users, it is the most popular OS in existence.

00 / The Evolution

The Founding Story

Before it was a global phenomenon, Android was a small startup with a radically different goal: building an operating system for digital cameras.

Origin Hub

  • Founded October 2003 in Palo Alto, CA.
  • Acquisition Bought by Google in August 2005 for approx. $50M.
  • First Device T-Mobile G1 (HTC Dream) — October 2008.

The Founders

Android Inc. was built by a powerhouse team of veteran engineers who envisioned a smarter, more open mobile world.

• Andy Rubin
• Rich Miner
• Nick Sears
• Chris White

Chronological History

Alphabetical release cycles ensure developers always know their environment version.

Ver. Codename Key Focus
15 Vanilla Ice Cream Private Space & Power
14 Upside Down Cake Customization & Battery
13 Tiramisu Themed Icons & Privacy
12 Snow Cone Material You Design
11 Red Velvet Cake Messaging & Media
10 Quince Tart Gesture Navigation
9.0 Pie Adaptive Battery
8.0 Oreo Picture-in-Picture
7.0 Nougat Split-screen Mode
6.0 Marshmallow App Permissions
5.0 Lollipop Material Design Introduction
4.4 KitKat Project Svelte (Low RAM)
4.1 Jelly Bean Project Butter (Fluid UI)
4.0 Ice Cream Sandwich Modern Android Styling
3.0 Honeycomb Tablet-only Era
2.3 Gingerbread NFC & Gaming Support
2.2 Froyo JIT & Voice Dialing
2.0 Eclair Google Maps Nav
1.6 Donut Quick Search Box
1.5 Cupcake Virtual Keyboard
01 / The Workshop

Android Studio

Based on IntelliJ IDEA, Android Studio is the official IDE for Google's Android operating system. It provides the fastest tools for building apps on every type of Android device.

Get Started

Download the official IDE to start building. Includes the Android SDK and emulators.

Min Req: 8GB RAM, 8GB Disk, 1280x800 Screen

OS: Windows 64-bit, macOS 10.14+, Linux

Download Android Studio

Gradle Build System

A powerful build automation tool that manages dependencies, build types (debug/release), and product flavors with ease.

Layout Inspector

Debug your UI in real-time. See exactly how your app is laid out on a device and inspect attributes on the fly.

Evolution of the IDE

2026
Preview Panda 4
2025.3.4 Canary
Panda 3 2025.3.3 RC
Panda 2 2025.3.2 Stable
Panda 1 2025.3.1 Stable
2025
Otter 2025.2.1 Stable
Narwhal 2025.1.1 Stable
M Meerkat 2024.3.1
2024
L Ladybug 2024.2.1
K Koala 2024.1.1
2023
J Jellyfish 2023.3.1
I Iguana 2023.2.1
H Hedgehog 2023.1.1
2022
G Giraffe 2022.3.1
F Flamingo 2022.2.1
E Electric Eel 2022.1.1
2021
D Dolphin 2021.3.1
C Chipmunk 2021.2.1
B Bumblebee 2021.1.1
2020
A Arctic Fox 2020.3.1

Quality Assurance

Testing

Verify app behavior automatically.

  • JUnit: Local unit tests (fast, no device).
  • Espresso: UI tests (runs on device/emulator).
Debugging

Fix issues efficiently.

  • Logcat: System logs & stack traces.
  • Breakpoints: Pause execution to inspect variables.
Linting

Static code analysis.

  • Lint: Finds structural/performance issues.
  • KtLint: Enforces Kotlin coding style.
02 / The Language

Why Kotlin?

Java was the standard, but Kotlin is the future. It dramatically reduces boilerplate code and avoids entire classes of errors (like NullPointerExceptions).

Java vs Kotlin

// Java User Code

public class User {
  private String name;
  public String getName() {
    return name;
  }
  public void setName(String n) {
    this.name = n;
  }
}

// Kotlin User Code

data class User(val name: String)

One line. Done.

02 / Essentials

Kotlin Language Basics

Clean, concise, and pragmatic. Kotlin reduces the noise in your code.

01. Hello World

fun main() {
  // Standard Output
  println("Hello, Android")
}

02. Variables

val (Value) Immutable (Read-only). Assigned once. Prefer this by default.
var (Variable) Mutable. Can be reassigned. Use only when necessary.
val name = "Human" // Inferred as String
var age: Int = 25
age = 26 // OK
name = "Other" // Error: Val cannot be reassigned

03. Functions

fun add(a: Int, b: Int): Int {
  return a + b
}

// Single Expression Syntax
fun multiply(a: Int, b: Int) = a * b

04. Key Keywords & Examples

class

class User(val name: String)
// Blueprint for objects

object

object Database {
  fun connect() { }
}
// Singleton instance

interface

interface Clickable {
  fun onClick()
}
// Contract definition

when

when (x) {
  1 -> print("One")
  else -> print("Other")
}
// Better switch-case

05. String Templates

val name = "Kotlin"
println("Hello, $name!") // Hello, Kotlin!
println("Length: ${name.length}") // Length: 6

06. Loops & Ranges

Ranges

1..5 // 1, 2, 3, 4, 5
1 until 5 // 1, 2, 3, 4
10 downTo 1 // Reverse

For Loop

for (i in 1..5) {
  print(i)
}

07. Collections

// Immutable List (Default)

val items = listOf("Apple", "Banana")
items.add("Orange") // Error

// Mutable List

val mutableItems = mutableListOf("Apple")
mutableItems.add("Orange") // OK

08. Asynchronism

Android has a Main Thread (UI) that must never be blocked. For long operations (Network, Database), use Coroutines.

// Suspend Function

suspend fun fetchData(): String {
  return withContext(Dispatchers.IO) {
    // Heavy work here...
    "Result"
  }
}

// Calling it

viewModelScope.launch {
  val data = fetchData()
  // Update UI with data
}
02.5 / Safety First

Null Safety

The "Billion Dollar Mistake" is fixed. In Kotlin, the type system distinguishes between references that can hold null (nullable references) and those that cannot (non-null references).

  • var a: String = "abc" a = null // Compilation Error
  • var b: String? = "abc" b = null // Allowed (Nullable type)
  • val l = b?.length Safe call. Returns length or null (no crash).
03 / Anatomy

The Android Project

Project Explorer

  • 📄 AndroidManifest.xml
  • 📂 java/
  • 📂 res/
  • 🐘 build.gradle
M

AndroidManifest.xml

The identity card of your app. It declares the app's package name, permissions (camera, internet), and registered activities.

03.5 / Core Components

The Four Pillars

Android apps are built from a combination of these loosely coupled components.

Activity

A single screen with a user interface. The entry point for user interaction.

Service

Runs in the background for long-running operations (music playback, downloads) without UI.

Broadcast Receiver

Listens for system-wide announcements (e.g., "Battery Low", "Screen Off").

Content Provider

Manages a shared set of app data (e.g., Contacts) that other apps can query.

04 / Pattern

App Architecture

Robust apps separate concerns. The recommended pattern is MVVM (Model-View-ViewModel), which decouples the UI from data and logic.

UI Layer (View)

Activities, Fragments, Composables

Displays data and captures user events. Observes the ViewModel.

Presentation (ViewModel)

State Holder

Holds UI state, handles logic, and exposes data streams. Survives config changes.

Data Layer (Model)

Repositories, Data Sources

The single source of truth. Manages application data (API, Database).

05 / Libraries

Essentials

Don't reinvent the wheel. Use the Android Jetpack libraries and community standards for common tasks.

Networking

Retrofit / OkHttp

Type-safe HTTP client for consuming REST APIs. Handles JSON parsing (GSON/Moshi) automatically.

Database

Room

Abstraction layer over SQLite. Provides compile-time checks of SQL queries and integrates with Coroutines/Flow.

Background Work

WorkManager

Schedule deferrable, asynchronous tasks that perform even if the app exits or device restarts.

Image Loading

Coil / Glide

Fast, memory-efficient image loading, catching, and display. Coil is Kotlin-first and Coroutine-based.

06 / The Modern UI

Jetpack Compose

The modern toolkit for building native Android UI. It simplifies and accelerates UI development on Android with less code, powerful tools, and intuitive Kotlin APIs.

@Composable
fun Greeting(name: String) {
    Text(text = "Hello $name!")
}

@Preview
@Composable
fun PreviewGreeting() {
    Greeting("Android")
}
                        

No more XML layouts. Just pure Kotlin code to describe your UI.

07 / Release

Publishing

Getting your app from Android Studio to the world. The process involves preparation, signing, and distribution.

Code
Build
Sign
Upload
Device
1

Prepare

  • Remove debug code and logging using BuildConfig.DEBUG check.
  • Update versionCode (integer, incremented) and versionName (string, e.g. "1.0.0") in build.gradle.
  • Run ProGuard/R8 to shrink and obfuscate code.
2

Sign

  • Generate a private signing key (Keystore) via Android Studio (Build > Generate Signed Bundle / APK).
  • Create an Android App Bundle (.aab). This serves optimized APKs to users.
  • Caution: Keep your keystore safe. If lost, you cannot update your app.
3

Console

  • Create an account on Google Play Console ($25 one-time fee).
  • Create App entry, fill details (Title, Description, Screenshots).
  • Upload your .aab to a release track (Internal, Closed, Open, or Production).
  • Submit for review.
08 / Terminology

Glossary

Common keywords and concepts you'll encounter in the Android ecosystem.

ADB

Android Debug Bridge. A command-line tool to communicate with a device (install apps, debug, shell).

APK / AAB

Android Package Kit / App Bundle. The file formats used to distribute and install apps.

Context

Interface to global information about an app environment. Access resources, launch activities, etc.

Gradle

The build system used by Android Studio to compile, test, and package your app.

Intent

A messaging object used to request an action from another app component (e.g., start an Activity).

Manifest

XML file describing essential information about the app (permissions, components) to the OS.

Fragment

A reusable portion of user interface in an Activity. Has its own lifecycle.

ANR

"Application Not Responding". A dialog displayed when the app freezes (blocks main thread).

Logcat

Command-line tool that dumps a log of system messages, including stack traces for errors.

09 / Knowledge Check

Assessment