Leanpub Header

Skip to main content

Topics

Kotlin

From null safety, classes and functions to coroutines, functional style, generics and metaprogramming, Android development and Kotlin Multiplatform, Kotlin as told through the free samples of the Leanpub books about it.

Created from the free samples of 12 Leanpub books and the descriptions and tables of contents of 20 more books and courses, with every source cited.

Kotlin is a programming language whose introduction on this shelf defines it in five terms: open-source, multiplatform, multi-paradigm, statically typed and general-purpose. Its compiler is freely available and is developed chiefly by one company, with a foundation to promote the language and a public process through which anyone can read and comment on proposed changes; it supports both object-oriented and functional programming; and every variable and function has a type known when the program is compiled.[1] The compiler can produce bytecode for the Java virtual machine, JavaScript or machine code, and on the first of these Kotlin and Java work together completely, each able to use the other's classes and libraries.[1]

The language has two main fields of use, the server and Android, and its best-known feature, a model of concurrency called coroutines, was largely designed with those two in view.[3] Much of the shelf comes from one author's series, which proceeds from the essentials through functional style and coroutines to the advanced features and a book of recommended practice.[1][4][2] The newest books are about sharing code between the two mobile platforms.[8]

This article covers where to begin, the history, the language, recommended practice, functional programming, coroutines, Android and multiplatform development. Its sources are the free samples of the Leanpub books listed at the end, with the descriptions and tables of contents of the books and courses whose samples were not available, and every claim that rests on a source is cited to it.

Where to start

Readers with no programming at all can start with Atomic Kotlin (2021), which introduces one idea in each very short chapter and tells experienced programmers where to skip ahead,[6] with Kotlin: An Illustrated Guide, an illustrated introduction in twenty chapters,[15] or with Android Kotlin For Newbies Volume 1, the first of five volumes that teach the language and Android development together to people with little or no background.[25] Kotlin Essentials is the introduction for those who already program,[1] the course Kotlin Essentials (2024) covers the same ground through runnable examples,[16] and KOTLIN - Quick Start (2021) is a set of short independent tutorials, laid out as reference cards, on the notations for each kind of value, the simple types and the collections.[12]

A developer who writes Kotlin daily should read Effective Kotlin, the best-selling core book here,[2] and then choose by need: Kotlin Coroutines assumes that the reader knows the language well,[3] Functional Kotlin covers its functional features,[5] and Advanced Kotlin is expressly for experienced developers who use variance, delegation and compiler plugins every day without being sure how they work.[4] Kotlin Exercises collects the exercises of the whole series with their solutions, as its author uses them in teaching, beginning with a first program and an inspection of what the compiler made of it.[11]

Mobile developers considering shared code have KMP for Mobile Native Developers and CMP for Mobile Native Developers, both written for people who already build native applications for one platform or the other,[8][9] and teams with applications already in production have Migrating Production Apps to Kotlin Multiplatform and Compose Multiplatform.[10]

History

Kotlin was announced in 2011 by a maker of development tools that wanted a more concise and safer language for the Java platform than Java then was, and reached version 1.0 in 2016. In 2017 it was accepted as a language for Android development and two years later was declared the preferred one, which made it within a few years the usual language of new Android applications. Coroutines became a stable part of the language in 2018. Compilation to targets other than the Java virtual machine, and with it the sharing of code between Android and Apple's platforms, matured more slowly and was declared stable in 2023.

The books add detail from the inside. Kotlin Essentials describes the commonest way a project comes to the language: new files are written in Kotlin beside the existing Java, old ones are converted as they are touched, and the proportion shifts over years. The compiler itself went this way, having begun in Java, and by the book's account still contained about a tenth Java at the time of writing.[1] Kotlin Coroutines places its subject in a longer history: the concept has been known in computer science since the 1960s, mainstream languages had used it only in a restricted form, one language then introduced a more general kind, and Kotlin built on that to produce what the author considers the most powerful and practical implementation so far.[3] The older titles on the shelf, Building Domain Specific Languages in Kotlin (2019) and Learn Simply: Android Mobile Application Development using Kotlin (2020), date from the years when the language was establishing itself on Android,[19][13] and the multiplatform books of 2026 are already in second editions or addressed to teams with shared code in production.[9][10]

The language

Kotlin Essentials takes care over the relation to Java. Compiling Kotlin for the Java virtual machine gives a result nearly identical to compiling Java; any Java library can be used from Kotlin, and Kotlin code from Java with one exception; and the two can be mixed in one project. It then sets out to correct what it calls a misconception, that the language is only a layer of convenient syntax over Java. Kotlin, it replies, has its own conventions and features that Java lacks, can be learned without Java, and is in the author's opinion the better first language, since a beginner need not learn to write the accessors, equality methods and standard patterns that it supplies. It is most mature on the Java platform and is chiefly used there, as an alternative to Java. Its code is written, where possible, to work on all three of the compiler's targets, though it concentrates on the most popular, and it explains that the language is compiled: the compiler turns what the programmer writes into code in a lower-level form.[1] Atomic Kotlin explains its own name: an atom is the smallest indivisible unit, and each chapter tries to introduce a single concept, because a language so rich in features, most of which can be expressed in several ways, will seem too complicated if everything arrives at once. It describes its intended reader as a dedicated novice, who is given just enough to work things out, and tells the experienced where to begin instead.[6]

The advanced material is in Advanced Kotlin, in three parts: features such as generic variance, delegation and contracts; the language on different platforms, including interoperation with Java and JavaScript; and metaprogramming, by reflection, annotation processing and compiler plugins. Its opening question to the reader is whether the tools used every day could be implemented, analysed and debugged if need be, and it describes its topics as ones that senior developers often do not understand well. The first is the variance of generic types, introduced with a box that may hold a dog or a puppy: whether a box of puppies can be used where a box of dogs is expected depends on a modifier on the box's type parameter, without which the two types are unrelated however their contents are.[4] Practical Kotlin Deep Dive takes the form of questions and answers on how the language works internally, from the basics and the standard library to coroutines, and has a course version.[17][18] Building Domain Specific Languages in Kotlin is a short book on designing small languages inside Kotlin, with a restaurant menu as its example.[19]

Three kinds of book use the language to teach something else. Kotlin Design Patterns for Android Interviews implements fifteen classic design patterns,[20] the three volumes of Learn Kotlin Data Structures & Algorithms Visually - Volume 1 present more than three hundred algorithms on trees, lists, strings and arrays step by step in colour,[21][22][23] and Kotlin Exercises is practice across the whole language.[11]

Effective Kotlin consists of sixty numbered items, each a rule of thumb with its reasons. The first, on safety, is to limit mutability. An element that holds state, the book explains with a bank account whose balance changes with each deposit and withdrawal, behaves according to its history as well as its use, and that is both useful and costly. A program with many points of mutation is harder to understand and to debug; the value of a mutable thing cannot be relied on from one moment to the next; shared state has to be synchronised in a program with several threads, every mutation being a possible conflict; and a change made in one part of a system can have effects in a quite different part. The item goes on to the language's means of restriction, properties that can be read and not written and collections that separate a read-only view from a mutable one. It is careful about what the first of these promises. A read-only property is not thereby immutable: it may hold an object that can itself be changed, or be computed afresh each time it is read. What it does not offer is a point at which it can be assigned, and points of assignment are the main source of trouble when a program has to be synchronised or reasoned about, which is why the read-only form is preferred. A property whose value is stated where it is defined is easier still, and the compiler can then draw conclusions from a check that it cannot draw for a computed one, whose value might differ between the check and the use.[2]

Functional programming

Functional Kotlin begins by admitting that there is no agreed definition of functional programming, and that two developers asked for one will give at least three answers. It lists instead the ideas usually associated with the term, treating functions as objects, functions that take or return functions, immutable data, expressions where other languages have statements, lazy evaluation, pattern matching and recursion, and then goes through the language's support for them, from function types and anonymous functions to the processing of collections and sequences.[5]

Functional Programming Ideas for the Curious Kotliner (2025) brings in ideas from further afield. One of the chief goals of the style, it says, is to be declarative, to state what is to be achieved and not how, which tends to give shorter and clearer code; the reputation of the subject, as either a cure for everything or a mystery reserved for mathematicians, is in its view wrong on both counts. The book is organised round four principles and a running example, a card game modelled with immutable data. The principles are to use the language of the problem's domain everywhere, to make explicit what a piece of code needs and what it does, to prefer the manipulation of data to complicated control flow, and to keep tight control of effects and dependencies; the author gives them an acronym, in the tradition of such things, and notes that how each is realised depends on the language, explicitness in Kotlin meaning very informative types. The first of them, that developers should adopt the vocabulary of the people they build for and not the reverse, is traced to domain-driven design and is served by the small languages that the style makes easy to build.[7] Programmation Résiliente avec Effets Asynchrones : Construire des Applications Modernes avec Kotlin et Arrow Fx (2025), written in French, is about managing effects with a functional library so that applications are reliable and testable.[24]

Coroutines

A coroutine is a computation that can be suspended and resumed, which lets code that waits, for a network or a disk, be written in the ordinary sequential way without occupying a thread while it waits. Kotlin Coroutines is the standard treatment. Its introduction begins with the reasons people give for wanting to learn them, that they are fashionable, lighter than threads or easier than an older library, rejects the description of coroutines as merely a convenient style and calls them the long-sought answer to concurrency, argues that the importance of concurrency is growing while the traditional techniques are no longer enough, and expects the industry as a whole to move this way. The book, based on a workshop whose participants' questions shaped it, has four parts: how suspension really works, the library built on it, the two abstractions for streams of values, and practice, with the common use cases of the server and Android. The two questions its participants asked most often were how coroutines really work and how to use them in practice, and the book answers in that order. Most chapters end with exercises, for which starting code and tests are published, and the sample records the versions of the language and library against which the text was last revised.[3] Android Kotlin For Newbies Volume 2 introduces coroutines to beginners in the course of calling web services and storing data.[26]

Android

Most Kotlin is written for Android, and the shelf has a book for each stage. Learn Simply: Android Mobile Application Development using Kotlin is a short textbook that teaches the language first and then builds applications with it, reaching within its first pages the rule for which Kotlin is best known, that a variable cannot hold nothing unless its type says that it may; the five-volume beginner's series does the same at greater length, its second volume reaching web services, local storage and background work;[13][26] the course Android Kotlin (2022) writes three small ones, among them a game of rock, paper, scissors;[27] and Android Development with Jetpack Compose & Kotlin (2026 Edition) is a practical guide to building applications with the platform's current libraries.[28]

The adjacent books go deeper into the platform than into the language. Jetpack Compose internals (2022), the most widely sold title in the extract, looks inside the declarative interface toolkit, at its compiler, its runtime and its system for tracking state,[30] and Jetpack Compose Mechanisms traces what happens beneath a function of that toolkit through the platform's source.[31] Android In The Real World is for developers who have already shipped applications and is about what breaks at scale. Its author, a consultant who has often joined products already large and fragile, writes that architectures which looked perfect on paper struggle under real use while simple ones survive because they respect constraints, and treats an Android application as one part of a system that also includes servers, build pipelines and monitoring.[14] and Manifest Android Interview is a collection of interview questions, each with a walk through its answer step by step.[32]

Multiplatform development

Kotlin Multiplatform lets one body of code be compiled for several targets, so that the logic of an application can be shared between Android and Apple's system while each keeps its own interface, or, with a further toolkit, shares that too. KMP for Mobile Native Developers begins by asking what multiplatform means in practice. Its first chapter compares the approaches to building for two platforms, sets out the trade-offs of each, surveys the competing technologies and asks the reader to assess whether sharing code is right for the project at all; later chapters order the strategies for adoption from the smallest scope to the largest, describe the model as flexible and not exclusive, discuss how real value is to be had from shared code and how the case should be put to a team, and then turn to the structure of a project, with its targets and sets of source files. Each chapter closes with a checklist.[8] CMP for Mobile Native Developers covers the shared interface toolkit for the same readers, in a second edition whose preface explains what has changed since the first and adds a note on the architectural choices it recommends,[9] Master Kotlin Multiplatform builds one production application for both platforms,[29] and Migrating Production Apps to Kotlin Multiplatform and Compose Multiplatform is an operational guide for moving existing applications across by increments.[10] The second part of Advanced Kotlin treats the subject from the language's side.[4]

Questions about Kotlin

Which Kotlin book should I start with?

Readers with no programming at all can start with Atomic Kotlin (2021), which introduces one idea in each very short chapter, or with Kotlin: An Illustrated Guide, an illustrated introduction in twenty chapters.[6][15] Kotlin Essentials is the introduction for those who already program.[1] A developer who writes Kotlin daily should read Effective Kotlin, sixty numbered items of recommended practice, each a rule of thumb with its reasons.[2]

Do I need to know Java before learning Kotlin?

Kotlin Essentials calls it a misconception that Kotlin is only a layer of convenient syntax over Java: the language has its own conventions and features that Java lacks and can be learned without Java.[1] In the author's opinion it is the better first language, since a beginner need not learn to write the accessors, equality methods and standard patterns that it supplies.[1] The two can still be mixed in one project, and any Java library can be used from Kotlin.[1]

What is Kotlin used for?

Kotlin has two main fields of use, the server and Android.[3] Its compiler can produce bytecode for the Java virtual machine, JavaScript or machine code, and Kotlin Essentials says the language is most mature on the Java platform and is chiefly used there, as an alternative to Java.[1]

What is a coroutine in Kotlin?

A coroutine is a computation that can be suspended and resumed, which lets code that waits, for a network or a disk, be written in the ordinary sequential way without occupying a thread while it waits. Kotlin Coroutines rejects the description of coroutines as merely a convenient style and calls them the long-sought answer to concurrency.[3] The book has four parts: how suspension really works, the library built on it, the two abstractions for streams of values, and practice, with the common use cases of the server and Android.[3]

Is a read-only property in Kotlin immutable?

A read-only property is not thereby immutable: it may hold an object that can itself be changed, or be computed afresh each time it is read.[2] What it does not offer is a point at which it can be assigned, and Effective Kotlin explains that points of assignment are the main source of trouble when a program has to be synchronised or reasoned about, which is why the read-only form is preferred.[2]

What is Kotlin Multiplatform?

Kotlin Multiplatform lets one body of code be compiled for several targets, so that the logic of an application can be shared between Android and Apple's system while each keeps its own interface. KMP for Mobile Native Developers compares the approaches to building for two platforms, sets out the trade-offs of each and asks the reader to assess whether sharing code is right for the project at all.[8] Teams with applications already in production have Migrating Production Apps to Kotlin Multiplatform and Compose Multiplatform, an operational guide for moving existing applications across by increments.[10]

Sources

Every source is a Leanpub book or course. The note after each says which part of it was read; where no sample was available, only the public description and table of contents were used.

  1. 1.
    Kotlin Essentials, Marcin Moskała Free sample: the opening chapter, on what Kotlin is, its platforms and its relation to Java; the front matter is withheld. 2026. Free sample: PDF · EPUB
  2. 2.
    Effective Kotlin, Marcin Moskała: Best practices Free sample: the first item, on limiting mutability; the introduction is withheld. 2026. Free sample: PDF · EPUB
  3. 3.
    Kotlin Coroutines, Marcin Moskała: Deep Dive Free sample: the introduction, on readers and structure, and the opening of the first part. 2026. Free sample: PDF · EPUB
  4. 4.
    Advanced Kotlin, Marcin Moskała Free sample: the introduction and the opening of the chapter on generic variance. 2026. Free sample: PDF · EPUB
  5. 5.
    Functional Kotlin, Marcin Moskała Free sample: the introduction and the opening chapter, on what functional programming is. 2026. Free sample: PDF · EPUB
  6. 6.
    Atomic Kotlin, Bruce Eckel, Svetlana Isakova Free sample: the introduction, on the book's approach, and a limited number of chapters. 2021. Free sample: PDF · EPUB
  7. 7.
    Functional Programming Ideas for the Curious Kotliner, Alejandro Serrano Mena Free sample: the contents and the introduction. 2025. Free sample: PDF
  8. 8.
    KMP for Mobile Native Developers, Santiago Mattiauda: A Hands-on Guide to Kotlin Multiplatform for Android and iOS Free sample: the table of contents and preface; cited for the outline of its first chapters. 2026. Free sample: PDF
  9. 9.
    CMP for Mobile Native Developers, Santiago Mattiauda: A Hands-on Guide to Compose Multiplatform for Android and iOS The free sample is front matter and contents: from those and the description. 2026. Free sample: PDF
  10. 10.
    Migrating Production Apps to Kotlin Multiplatform and Compose Multiplatform, Anubhav Savant: An Operational Guide for Migrating Existing Production Android and iOS Apps to Kotlin Multiplatform and Compose Multiplatform The free sample is a table of contents only: from that and the description. 2026. Free sample: PDF
  11. 11.
    Kotlin Exercises, Marcin Moskała Free sample: the introduction and the first exercises. 2026. Free sample: PDF · EPUB
  12. 12.
    KOTLIN - Quick Start, Ivor Online: Version: 2.0 - Date: 04.2021 Free sample: the opening tutorials, on literals and data types. 2021. Free sample: PDF
  13. 13.
    Learn Simply: Android Mobile Application Development using Kotlin, Dr. Iyad Abu Doush: Mastering Android Programming Free sample: part of the introduction to the language; the preface is withheld. 2020. Free sample: PDF · EPUB
  14. 14.
    Android In The Real World, Fabio Chiarani: Android in the real world: Engineering Jetpack Compose, performance, architecture, and scale under real production constraints. Free sample: the opening chapter, on the author's experience and the book's point of view. 2026. Free sample: PDF
  15. 15.
    Kotlin: An Illustrated Guide, Dave Leeds: The fun way to learn Kotlin programming, one concept at a time! No sample: from the description and table of contents. 2026.
  16. 16.
    Kotlin EssentialsCourse, Marcin Moskała No sample text (the download failed): from the description and outline of the course. 2024.
  17. 17.
    Practical Kotlin Deep Dive, Jaewoong: Unlocking the 'How' and 'Why' behind Kotlin fundamentals and internal mechanisms. No sample: from the description and table of contents. 2026.
  18. 18.
    Practical Kotlin Deep Dive CourseCourse, Jaewoong: Unlocking the 'How' and 'Why' behind Kotlin fundamentals and internal mechanisms. No sample: from the description; the course version of the question-and-answer book. 2026.
  19. 19.
    Building Domain Specific Languages in Kotlin, Greg Milette: Kotlin language features and software design patterns for creating DSLs and improving code No sample: from the description and table of contents. 2019.
  20. 20.
    Kotlin Design Patterns for Android Interviews, Mahmoud Ramadan: Master the 15 Patterns That Get You Hired No sample: from the description and table of contents. 2026.
  21. 21.
    Learn Kotlin Data Structures & Algorithms Visually - Volume 1, Flannan P. Brody: Data Structures & Algorithms for AI-Era Interviews The sample holds no extractable text: from the description. 2026. Free sample: PDF
  22. 22.
    Learn Kotlin Data Structures & Algorithms Visually - Volume 2, Flannan P. Brody: Data Structures & Algorithms for AI-Era Interviews The sample holds no extractable text: from the description. 2026. Free sample: PDF
  23. 23.
    Learn Kotlin Data Structures & Algorithms Visually - Volume 3, Flannan P. Brody: Data Structures & Algorithms for AI-Era Interviews The sample holds no extractable text: from the description. 2026. Free sample: PDF
  24. 24.
    Programmation Résiliente avec Effets Asynchrones : Construire des Applications Modernes avec Kotlin et Arrow Fx, Able Samuel No sample: from the description and table of contents of a book in French. 2025.
  25. 25.
    Android Kotlin For Newbies Volume 1, José Canelas No sample: from the description and table of contents. 2026.
  26. 26.
    Android Kotlin For Newbies Volume 2, José Canelas No sample: from the description and table of contents. 2026.
  27. 27.
    Android KotlinCourse, Blake Dudash No sample: from the description and outline of the course. 2022.
  28. 28.
    Android Development with Jetpack Compose & Kotlin (2026 Edition), A.P. Pyre: Build Modern Apps Using Android Studio, Material 3 & Google’s Latest Tools No sample: from the description and table of contents. 2026.
  29. 29.
    Master Kotlin Multiplatform, Mahmoud Ramadan: Build Production-Ready Android and iOS Apps with Kotlin Multiplatform, Compose Multiplatform, Ktor, Coroutines, and Modern Architecture No sample: from the description and table of contents. 2026.
  30. 30.
    Jetpack Compose internals, Jorge Castillo No sample: from the description and table of contents. 2022.
  31. 31.
    Jetpack Compose Mechanisms, Jaewoong: A dissection of what runs beneath every @Composable No sample: from the description and table of contents. 2026.
  32. 32.
    Manifest Android Interview, Jaewoong: The ultimate guide to cracking Android technical interviews No sample: from the description and table of contents. 2026.

Further reading

Other books and courses in the library on neighbouring ground, not cited above.

  • Jetpack Compose Mechanisms CourseCourse, Jaewoong: A dissection of what runs beneath every @Composable The course version of the book on what runs beneath the Android interface toolkit. 2026.
  • Manifest Android Interview CourseCourse, Jaewoong: The ultimate guide to cracking Android & Compose technical interviews. An interview-preparation course built from the book of Android interview questions. 2026.
  • Android Kotlin For Newbies Volume 3, José Canelas The third volume of the beginner's series, on application architecture. 2026.
  • Mastering Android Screenshot Testing, Alex Zhukovich An introduction to testing Android applications by comparing recorded images of their screens. 2026. Free sample: PDF
  • Cracking the Mobile System Design Interview, Mahmoud Ramadan: A Practical Guide to Android & iOS Architecture with Production-Ready Code A framework and eight case studies for system design interviews in mobile development. 2026.
  • On-Device GenAI with Android Kotlin, Edgar Milvus: Mastering Gemini Nano, AICore, and local LLM deployment using MediaPipe and Custom TFLite models Running generative models on Android devices. 2026.

This is an article created from the free samples of 12 Leanpub books and the descriptions and tables of contents of 20 more books and courses. We're building these articles to provide you, the Leanpub reader, with a good jumping-off point to discover more Leanpub books that are interesting and relevant to you. We never use material which is paid-only when building these articles: we only use material which is already free on Leanpub. However, Leanpub authors can opt out from inclusion in articles from their book settings page.

Updated November 2026.

In the Leanpub store: 86 books · 5 courses in the Kotlin category · also filed under Kotlin Multiplatform

All topics