Kotlin Basics I — Variables, Operators, Control Flow
Start with pure Kotlin (no Android yet). You'll declare variables, use arithmetic and comparison operators, and control flow with if/when/loops. This is the syntax you'll use in every later day.
Key concepts
- val vs var (immutable vs mutable)
- Type inference and explicit types
- Arithmetic and comparison operators
- if as an expression
- when expression and ranges
- for, while, do-while loops
Lectures in this day
- 01
Course Overview
Here is what you will do in 12 days. First 2 days: learn the Kotlin language (the words we write). Next 2 days: learn how to build with classes (little machines). Next 2 days: make your first real Android screens. After that: connect screens, save data on the phone, then finish with a full app that uses Firebase (a free cloud database).
Real life · Think of it like a 12-day sports camp. On Day 1 you just warm up. By Day 12 you can play a full match.Practice · 3 quick questions
Q1.How many days is this roadmap?
Q2.What do the first two days focus on?
Q3.What is Firebase used for in Day 11+?
Pick one answer per question. - 02
Declaring Variables (Part 1)
A variable is a labeled box that holds a value. Kotlin has two kinds. `val` is a box you fill once and never change (like your date of birth). `var` is a box you can refill any time (like today's score in a game).
Real life · `val` is your birthday — written once, never changes. `var` is the money in your wallet — it goes up and down all day.kotlinval id: String = "NID-1990-42" 0