Beginner: Kotlin · Kotlin basics · topic 1 of 50 · 20 min
Kotlin and Android: the big picture
Explanation
What is Android?
Android is an operating system: the base software that runs a phone, like Windows runs a laptop. It is made by Google and is open source, so many brands (Samsung, Xiaomi, Vivo, OnePlus and others) use it. In India, the large majority of smartphones run Android, so an Android app can reach a very large audience, from metro cities to small towns.
What is Kotlin?
Kotlin is a programming language created by JetBrains, the company behind IntelliJ IDEA. It first became stable in 2016. In 2017 Google announced official support for Kotlin on Android, and in 2019 it declared Android development "Kotlin-first": new Android libraries, documentation and samples are written for Kotlin. Today most professional Android apps are written in Kotlin.
- Concise: the same logic usually needs far fewer lines than in Java.
- Null-safe: the compiler stops most "null pointer" crashes before the app runs (module 2).
- Interoperable: Kotlin and Java code can live in the same project and call each other.
- Modern: coroutines make slow work like network calls easy to write (module 4).
- Multi-platform: Kotlin also runs on servers and, with Kotlin Multiplatform, can share code with iOS.
Compiled and typed
Kotlin is a compiled language: a program called the compiler checks your code and turns it into something the device can run. It is also statically typed: every value has a type (number, text, true/false) known before the program runs, so many mistakes are caught early. You will see compiler errors often; they are your friend.
What you will build in this course
| Part | You learn | You can then build |
|---|---|---|
| Beginner (Kotlin) | Basics, null safety, functions, classes, collections, coroutines | Console programs and clean Kotlin logic |
| Intermediate (Android basics) | Android Studio, Compose UI, navigation, MVVM, Room, Retrofit | A multi-screen app that saves data and calls an API |
| Expert (features and shipping) | Permissions, Material 3, testing, Play Store, Firebase | A tested, published app |
Tools for this module
For the Kotlin modules you do not need Android Studio yet. Use the Kotlin Playground at play.kotlinlang.org, a free website that runs Kotlin code in your browser. Later, in module 5, you will install Android Studio, the official app-building tool.
Common mistakes when starting
- Jumping straight into Android screens without learning Kotlin. Android code is much easier once the language feels natural.
- Learning Java first "because Android used to use it". Start with Kotlin; you can read Java later.
- Copying old tutorials that use XML layouts and Java. They still work, but new apps use Kotlin and Jetpack Compose.
Need help?
Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.
Try:
Watch the lesson
Kotlin and Android: the big picture · 1/6
Welcome. Android runs most smartphones in India, and Kotlin is the language Google recommends for Android apps.
Prefer a video by a teacher? Find free videos on “what is kotlin android development introduction” on YouTube ↗
In real life: One app, millions of phones
A small team in Jaipur builds a Kotlin Android app for booking local tour guides. Because most of their customers use Android phones of many brands and price levels, one Kotlin app reaches almost all of them. Kotlin's null safety means fewer crashes on the cheap phones with patchy networks that many of their users have, which shows up as better ratings on the Play Store.
fun main() {
val app = "GuideMe"
val cities = 12
println("$app works in $cities cities")
}Practice (0/2 done)
Since 2019, how does Google describe Android development?
Open play.kotlinlang.org, run the default program, then change it to print your name and the name of an app you would like to build. Write two sentences on why Kotlin is a good choice for that app.
Quick quiz
Read more (free)
Related help
Related topics
- First program, val and var, and typesKotlin basics · same module
- Conditions: if and whenKotlin basics · same module
- Loops and rangesKotlin basics · same module
- What Java is and where it is usedJava Programming (Core to Spring Boot) · Getting started with Java
- Portfolio and next stepsAndroid career path
- Hello Compose: your first screenAndroid Studio and your first app
Questions people ask about this
Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.
Who created Kotlin?
Answer: JetBrains
JetBrains created Kotlin; Google adopted it for Android.
Which is a key safety feature of Kotlin?
Answer: Null safety checked by the compiler
Kotlin's type system separates values that can be null from those that cannot.
Can Kotlin and Java code be used in the same Android project?
Answer: Yes, they interoperate
Kotlin was designed to work alongside Java.
What is the recommended modern way to build Android screens?
Answer: Jetpack Compose with Kotlin
Compose is Android's recommended UI toolkit.
What runs Java bytecode?Related
Answer: The Java Virtual Machine (JVM)
Bytecode runs on the JVM.
Which Google sample app demonstrates modern Android architecture?Related
Which function shows Compose content in an activity?Related
Which skill appears in almost every modern Android job post?Related
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.
Next steps
- 3 more topics in “Kotlin basics” before its exam: First program, val and var, and types, Conditions: if and when, Loops and ranges.
- Module 1 exam: Kotlin basics · 13 questions · 20 min, without help. 4 topics of this module still to finish first.
- Then the next module, Null safety, functions and lambdas. 50 topics left in the course before the final exam.