๐ŸŒ Android Development ยท subject

Android Development Kotlin Programming Syllabus

The Kotlin Programming syllabus for Android Development in full: 8 chapters, 22 topics and 69 sub-topics, every one listed below, plus 51 Kotlin Programming flashcards with answers.

8Chapters
22Topics
69Sub-topics
51Flashcards

Kotlin Programming syllabus: all 8 chapters

Expand any chapter to see its topics and sub-topics.

  1. Introduction to Kotlin

    2 topics
    • Overview
      • What is Kotlin?
      • History of Kotlin
      • Why Kotlin?
      • Kotlin vs Java
    • Setup
      • Installing Kotlin
      • Setting up Kotlin in IntelliJ IDEA
      • Setting up Kotlin in Android Studio
      • Command Line Compilation
  2. Basic Syntax

    3 topics
    • Hello World
      • Writing your first Kotlin program
      • Understanding the main function
    • Variables and Data Types
      • var vs val
      • Primitive Data Types
      • Type Inference
      • Nullable Types
    • Control Flow
      • Conditional Statements
      • Loops
      • Ranges
      • When Expression
  3. Object-Oriented Programming

    3 topics
    • Classes and Objects
      • Defining Classes
      • Constructors
      • Properties
      • Methods
    • Inheritance
      • Open Classes
      • Overriding Methods
      • Abstract Classes
      • Interfaces
    • Visibility Modifiers
      • Public
      • Private
      • Protected
      • Internal
  4. Advanced Concepts

    3 topics
    • Extensions
      • Extension Functions
      • Extension Properties
    • Higher-Order Functions and Lambdas
      • Lambda Expressions
      • Inline Functions
      • Function Types
    • Coroutines
      • Introduction to Coroutines
      • Building Blocks of Coroutines
      • Coroutine Context and Dispatchers
      • Structured Concurrency
  5. Standard Library

    3 topics
    • Collections
      • List
      • Set
      • Map
      • Sequence
    • Scope Functions
      • let
      • run
      • with
      • apply
      • also
    • String Manipulation
      • String Templates
      • String Operations
  6. Kotlin for Android Development

    3 topics
    • Getting Started
      • Setting up Android Studio
      • Creating a New Project
    • Kotlin Android Extensions
      • View Binding
      • Synthetic Properties
    • Coroutines in Android
      • Using Coroutines with ViewModel
      • Handling Lifecycle with Coroutines
  7. Testing in Kotlin

    2 topics
    • Unit Testing
      • JUnit Integration
      • Mocking
      • Writing Test Cases
    • Android Testing
      • Espresso
      • Robolectric
      • UI Testing
  8. Kotlin Multiplatform

    3 topics
    • Introduction
      • What is Kotlin Multiplatform?
      • Setting up Multiplatform Project
    • Shared Code
      • Expect/Actual Declarations
      • Common Code
    • Platform-Specific Code
      • JVM Code
      • JS Code
      • Native Code

Android Development Kotlin Programming flashcards โ€” 51 questions with answers

  1. What is Kotlin and who develops it?

    Kotlin is a statically typed, cross-platform, general-purpose programming language developed by JetBrains. It runs on the JVM, compiles to JavaScript and native code, and is fully interoperable with Java. Since 2019 it is Google's preferred language for Android development.

  2. Name three key features that distinguish Kotlin from Java.

    (1) Null safety built into the type system, (2) concise syntax (no semicolons, type inference, data classes), and (3) 100% Java interoperability. Others include extension functions, coroutines, and no checked exceptions.

  3. What file extension do Kotlin source files use, and what does the compiler produce?

    Kotlin source files use the .kt extension (or .kts for scripts). The kotlinc compiler produces .class bytecode files that run on the JVM, packaged into JARs like Java.

  4. What is required to set up Kotlin for Android development?

    Android Studio (which bundles the Kotlin plugin and compiler) and the Android SDK. The Kotlin Gradle plugin (org.jetbrains.kotlin.android) is applied in the module build.gradle to compile Kotlin code.

  5. Write a minimal Kotlin 'Hello World' program.

    fun main() { println("Hello, World!") } The entry point is the top-level main function; println prints a line to standard output. main may optionally take args: Array<String>.

  6. What is the difference between val and var in Kotlin?

    val declares a read-only (immutable) reference that can be assigned only once (like final in Java). var declares a mutable reference that can be reassigned. Both are locally type-inferred if a type is not specified.

  7. List the basic numeric data types in Kotlin and their bit sizes.

    Byte (8-bit), Short (16-bit), Int (32-bit), Long (64-bit), Float (32-bit), Double (64-bit). Also Boolean, Char (16-bit), and String. Unsigned variants exist: UByte, UShort, UInt, ULong.

  8. How does Kotlin handle null safety with nullable and non-nullable types?

    By default types are non-nullable (String cannot hold null). Appending ? makes a type nullable (String?). Accessing members requires safe calls (?.), the Elvis operator (?:), or the non-null assertion (!!).

  9. What does the safe-call operator (?.) do in Kotlin?

    It calls a member only if the receiver is non-null; if the receiver is null, the whole expression evaluates to null instead of throwing a NullPointerException. Example: a?.length returns null when a is null.

  10. What is the Elvis operator (?:) and when is it used?

    The Elvis operator provides a default value when the left-hand expression is null. In val len = a?.length ?: 0, len becomes the string length or 0 if a is null.

  11. Compare Kotlin's if used as an expression versus a statement.

    In Kotlin if is an expression that returns a value, so it can replace Java's ternary operator: val max = if (a > b) a else b. There is no ?: ternary conditional; if/else is used instead.

  12. How does the when expression work in Kotlin?

    when is a multi-branch conditional (like an enhanced switch) that can match values, ranges (in 1..10), types (is String), or arbitrary boolean conditions. Used as an expression it must be exhaustive and returns a value; else is the default branch.

  13. Describe Kotlin's for loop and how ranges are used with it.

    for iterates over anything providing an iterator: for (x in collection). Ranges create sequences: for (i in 1..5) (inclusive), for (i in 1 until 5) (exclusive end), for (i in 5 downTo 1), and step: for (i in 0..10 step 2).

  14. What is the difference between break/continue and labeled break in Kotlin loops?

    break exits the nearest enclosing loop and continue skips to its next iteration. Labels (e.g. outer@) let you target an outer loop: break@outer or continue@outer control the labeled loop instead of the innermost one.

  15. How do you declare a class with a primary constructor in Kotlin?

    class Person(val name: String, var age: Int) The primary constructor is part of the class header. Prefixing parameters with val/var declares them as properties. Initialization logic goes in an init { } block.

  16. What is a data class in Kotlin and what does it auto-generate?

    A data class (data class User(val name: String)) automatically generates equals(), hashCode(), toString(), copy(), and componentN() destructuring functions based on the primary-constructor properties. It must have at least one constructor parameter.

  17. What is the difference between a class and an object declaration in Kotlin?

    A class is a blueprint you instantiate. An object declaration defines a singleton โ€” a single instance created lazily on first access โ€” with no constructor. It is Kotlin's idiom for singletons and utility holders.

  18. What is a companion object and what is it used for?

    A companion object is a single object declared inside a class with the companion keyword. It holds members tied to the class (not instances), serving as Kotlin's equivalent of Java's static members, e.g. factory methods and constants.

  19. By default, are Kotlin classes open or closed to inheritance? How do you enable subclassing?

    Kotlin classes are final (closed) by default. To allow subclassing you must mark the class open. Methods and properties must also be marked open to be overridden, and overrides use the override keyword.

  20. How is inheritance syntax written in Kotlin?

    open class Animal(val name: String) class Dog(name: String) : Animal(name) The superclass is listed after a colon and its constructor is called in the header. override is required on overriding members; super refers to the parent.

Show the other 31 Kotlin Programming flashcards
  1. What is the difference between an abstract class and an interface in Kotlin?

    An abstract class cannot be instantiated, can hold state, and may mix abstract and concrete members (abstract members are implicitly open). An interface cannot store state (no backing fields) but can have abstract members and default method implementations; a class can implement many interfaces but extend only one class.

  2. List Kotlin's four visibility modifiers and their default.

    public (default โ€” visible everywhere), private (visible in the file or enclosing class), protected (visible in the class and subclasses; not for top-level), and internal (visible within the same module).

  3. What does the internal visibility modifier mean in Kotlin?

    internal makes a declaration visible everywhere within the same module (a set of files compiled together, e.g. a Gradle source set or IntelliJ module). It has no direct Java equivalent.

  4. What is an extension function in Kotlin? Give an example.

    An extension function adds a function to an existing type without modifying its source or inheriting from it. Example: fun String.lastChar(): Char = this[length - 1]. Inside, this is the receiver. Resolved statically at compile time.

  5. Can an extension function override a member function with the same signature?

    No. If a class already has a member function with the same name and signature, the member always takes precedence โ€” extensions are dispatched statically by declared type and cannot override members.

  6. What is a higher-order function in Kotlin?

    A higher-order function is a function that takes another function as a parameter and/or returns a function. Example: fun calc(x: Int, op: (Int) -> Int): Int = op(x). Function types are written (params) -> ReturnType.

  7. What is a lambda expression in Kotlin and how is it written?

    A lambda is an anonymous function literal enclosed in braces: { x: Int -> x * 2 }. Parameters precede ->, and the last expression is the return value. A single parameter can be referenced implicitly as it.

  8. What is the trailing lambda convention in Kotlin?

    If the last parameter of a function is a lambda, it can be placed outside the parentheses: list.filter { it > 0 }. If the lambda is the only argument, the parentheses can be omitted entirely.

  9. What is a coroutine in Kotlin?

    A coroutine is a lightweight, suspendable computation for asynchronous, non-blocking programming. Many coroutines can run on few threads because suspension frees the thread rather than blocking it. Provided by the kotlinx.coroutines library.

  10. What does the suspend keyword do in Kotlin?

    suspend marks a function that can pause (suspend) execution without blocking the underlying thread and resume later. Suspend functions can only be called from another suspend function or a coroutine builder like launch or async.

  11. Compare the launch and async coroutine builders.

    launch starts a coroutine that does not return a result and returns a Job (fire-and-forget). async starts a coroutine that computes a value and returns a Deferred<T>, whose result is retrieved by calling await().

  12. What is a CoroutineScope and why does structured concurrency matter?

    A CoroutineScope defines the lifecycle and context in which coroutines run. Structured concurrency ties child coroutines to their scope, so cancelling or completing the scope cancels/awaits all children, preventing leaks. Examples: viewModelScope, lifecycleScope.

  13. What is a Dispatcher in Kotlin coroutines and name the main ones.

    A CoroutineDispatcher determines which thread(s) a coroutine runs on. Dispatchers.Main (UI thread), Dispatchers.IO (blocking I/O like network/disk), Dispatchers.Default (CPU-intensive work), and Dispatchers.Unconfined.

  14. What is the difference between a List and a MutableList in Kotlin collections?

    List is a read-only interface (only accessors like get, size); it cannot be modified through that reference. MutableList adds mutating operations (add, remove, set). listOf() creates a read-only list; mutableListOf() creates a mutable one.

  15. Name Kotlin's three main collection types and their factory functions.

    List (ordered, allows duplicates) via listOf/mutableListOf; Set (unordered, unique elements) via setOf/mutableSetOf; Map (key-value pairs) via mapOf/mutableMapOf. Each has read-only and mutable variants.

  16. What do the map, filter, and reduce collection functions do?

    map transforms each element and returns a new collection. filter keeps elements matching a predicate. reduce/fold accumulates elements into a single value (fold takes an initial value). All are higher-order functions that take lambdas.

  17. What is the difference between a Sequence and a List for chained operations?

    A List processes each operation eagerly, creating an intermediate collection at each step. A Sequence processes elements lazily, one element through the whole chain at a time, avoiding intermediates โ€” more efficient for large data or long chains.

  18. List Kotlin's five scope functions.

    let, run, with, apply, and also. They execute a block of code in the context of an object, differing in how the object is referenced (this vs it) and what they return (the lambda result vs the object itself).

  19. Compare apply and also scope functions.

    Both return the context object itself (useful for chaining/configuration). apply references the object as this (implicit receiver, good for setting properties). also references it as it (good for side effects like logging or validation).

  20. Compare let and run scope functions.

    Both return the lambda result. let references the object as it and is common for null-checks (obj?.let { }) and scoping locals. run references the object as this and is handy for object configuration that computes a result.

  21. How do you use string templates in Kotlin?

    String templates embed expressions in a string with $. A simple variable: "Hello $name". An arbitrary expression uses braces: "Sum is ${a + b}". This avoids manual concatenation.

  22. What is a raw (triple-quoted) string in Kotlin?

    A raw string is delimited by triple quotes ("""...""") and contains no escaping โ€” it preserves newlines and special characters literally. trimIndent() or trimMargin() is used to remove leading indentation.

  23. Name three common Kotlin String functions for manipulation.

    length (character count), substring(start, end), uppercase()/lowercase(), trim(), split(delimiter) (returns a List), replace(old, new), and contains/startsWith/endsWith. Strings are immutable, so these return new strings.

  24. In Android, what does the 'Getting Started' step of enabling Kotlin involve for a new project?

    In Android Studio, select Kotlin as the project language; the wizard applies the Kotlin Gradle plugin, adds the kotlin-stdlib dependency, and generates Activities in Kotlin. Existing Java projects can add Kotlin via 'Configure Kotlin in Project'.

  25. What were Kotlin Android Extensions (kotlin-android-extensions) used for?

    They provided synthetic view binding โ€” importing kotlinx.android.synthetic.* let you access views directly by their XML id without findViewById. The plugin is now deprecated in favor of View Binding / Jetpack Compose.

  26. Why were Kotlin synthetics (Kotlin Android Extensions) deprecated, and what replaced them?

    Synthetics polluted the global namespace, exposed views from other layouts, and weren't null-safe or type-safe across modules. They were deprecated in 2020 and replaced by Jetpack View Binding (and Jetpack Compose).

  27. In Android, how do coroutines help avoid blocking the main thread?

    Long-running work (network, database) runs in a coroutine on a background dispatcher (Dispatchers.IO) using withContext, while UI updates happen on Dispatchers.Main. This keeps the UI responsive without callbacks, replacing AsyncTask.

  28. What lifecycle-aware coroutine scopes does Android Jetpack provide?

    viewModelScope (tied to a ViewModel, cancelled when it clears), lifecycleScope (tied to a Lifecycle owner like an Activity/Fragment), and repeatOnLifecycle for collecting flows only in a given state. They enforce structured concurrency and prevent leaks.

  29. What frameworks are commonly used for unit testing Kotlin code?

    JUnit (4 or 5) as the test runner with kotlin.test assertions, MockK for Kotlin-friendly mocking, and for coroutines kotlinx-coroutines-test (runTest, TestDispatcher). AssertJ or Truth are common assertion libraries.

  30. How do you write and run a basic unit test in Kotlin with JUnit?

    Annotate a function with @Test inside a test class and assert an expected outcome: @Test fun addsNumbers() { assertEquals(4, add(2, 2)) } Test files live in src/test/kotlin and are run via ./gradlew test.

  31. How do you test suspend functions and coroutines in unit tests?

    Use runTest from kotlinx-coroutines-test, which provides a controlled TestScope with virtual time so delays are skipped instantly: @Test fun example() = runTest { val result = fetchData() assertEquals(expected, result) }

Android Development Kotlin Programming FAQ

What is in the Android Development Kotlin Programming syllabus?

Android Development Kotlin Programming is split into 8 chapters: Introduction to Kotlin, Basic Syntax, Object-Oriented Programming, Advanced Concepts, Standard Library, Kotlin for Android Development, Testing in Kotlin and Kotlin Multiplatform. Together they contain 22 topics and 69 sub-topics.

How many chapters are in Android Development Kotlin Programming?

8 chapters, containing 22 topics and 69 sub-topics. The largest chapter is Basic Syntax, with 3 topics.

Are there flashcards for Android Development Kotlin Programming?

Yes โ€” a 51-card Kotlin Programming deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.