Cheat Sheets

Kotlin Beginner Cheat Sheet: Syntax, Types, When & First Android Snippets

By ArpaNeuro Team September 19, 2026
Kotlin beginner cheat sheet

A beginner Kotlin cheat sheet is the language before architecture: val vs var, type inference, if/when as expressions, functions, lists, and the first null-safe call. On Android you will type these inside activities or composables; the grammar is the same on the JVM backend.

This Kotlin cheat sheet is written for people searching for a fast, accurate reference: students, junior developers, and teams shipping production software. Pin it, copy the snippets, and come back when syntax slips.

Quick reference

  • val / var: val read-only binding. var reassignable. Prefer val.
  • Types: Int, Long, Double, Boolean, String. Inference: val n = 3.
  • String tpl: "Hello \$name" and "\${user.email}".
  • if / when: Both can return values: val x = if (ok) 1 else 0.
  • Functions: fun add(a: Int, b: Int): Int = a + b.
  • Lists: listOf(1, 2), for (item in list), list.map { it * 2 }.
  • Null: String?, ?., ?:. Avoid !! while learning.
  • Run: Android Studio / IntelliJ scratch file, or kotlinc for JVM. Android needs a device/emulator.

Copy-paste examples

When expression and a list transform

Type this until it is boring. Then add null safety on a String?.

fun grade(score: Int): String = when {
    score >= 90 -> "A"
    score >= 80 -> "B"
    score >= 70 -> "C"
    else -> "F"
}

fun activeTitles(rows: List<Pair<String, Boolean>>): List<String> =
    rows.filter { it.second }.map { it.first }

Common mistakes

  • Starting with coroutines, Dagger, and Compose together on day one.
  • Using !! because the compiler complained.
  • Writing Java in Kotlin files (System.out.println everywhere is fine, but skip getters).
  • Ignoring error messages in red — Kotlin’s compiler is trying to teach null safety.

FAQ

  1. Do I need Java first? Helpful, not required. You will still read Java docs. Learn Kotlin types and nulls first if Android is the goal.
  1. What is a package? A namespace matching folders: package com.example.app. Imports bring types into a file.
  1. How do I print? println("hi"). In Android, Log.d("TAG", "hi") shows in Logcat.

Related Kotlin cheat sheets

Build with this stack

When a cheat sheet is not enough — you need a production app, a student FYP, or a custom dashboard — ArpaNeuro builds mobile app development and also sells ready-made source code. Request a quote and tell us the stack.

Browse software development services or the source code marketplace if you want a working codebase instead of starting from a blank file.

← All Articles Get a Quote →