Lecture 01 ยท Fundamentals
Introduction to Kotlin & Setup
What is Kotlin?
Kotlin is a modern, concise, and safe programming language developed by JetBrains. It is fully interoperable with Java and is the preferred language for Android development.
Why Kotlin?
- Null safety built into the type system
- Concise and expressive syntax
- Excellent multiplatform support (Kotlin Multiplatform)
- Seamless Java interoperability
- Official language for Android
Installation & Setup
Download IntelliJ IDEA (Community Edition) or use Android Studio.
Hello.kt
fun main() { println("Hello, Kotlin Mastery!") println("Modern, safe, and fun!") }
Output
Hello, Kotlin Mastery!Modern, safe, and fun!
๐ฏ Exercise 1.1
Create a new Kotlin project in IntelliJ IDEA or Android Studio and run a program that prints your name and favorite feature of Kotlin.
Lecture 02 ยท Fundamentals
Variables & Data Types
val vs var
Use val for read-only variables and var for mutable variables.
val pi = 3.14 var score = 0 score = 10 // OK
Lecture 03 ยท Fundamentals
Control Flow & Expressions
When Expression
Kotlin's powerful replacement for the switch statement.
val result = when (x) { 1 -> "One" 2 -> "Two" else -> "Other" }
Lecture 04 ยท Fundamentals
Functions
fun sum(a: Int, b: Int): Int = a + b
Lecture 05 ยท Fundamentals
Collections
val list = listOf("Apple", "Banana") val mutableList = mutableListOf(1, 2)
Lecture 06 ยท Core Concepts
Classes & Objects
Data Classes
Concise classes used to hold data.
data class User(val name: String, val age: Int)
Lecture 07 ยท Core Concepts
Null Safety & Extensions
Safe Calls
val length = name?.length ?: 0
Lecture 08 ยท Core Concepts
Generics & Inline Functions
Lecture 09 ยท Advanced
Coroutines & Async
Structured Concurrency
suspend fun fetchData() { delay(1000) println("Data fetched") }
Lecture 10 ยท Advanced
Android Development Basics
Building modern Android UIs with Jetpack Compose.
Lecture 11 ยท Advanced
Multiplatform & Ktor
Share code across iOS and Android using Kotlin Multiplatform (KMP).
Lecture 12 ยท Capstone
Capstone Project: Android App
Build a fully functional Android Task Tracker using Kotlin, Jetpack Compose, and Room Database.
// Project requirements: // 1. Use Coroutines for background tasks // 2. Implement a local Room database // 3. Design the UI with Jetpack Compose // 4. Use ViewModel for state management