Skip to main content Skip to navigation

Documentation

Everything you need to build irresistible applications

Building with Kotlin

Create modern applications for Android, iOS, web, and desktop with JetBrains' pragmatic language

Why Choose Kotlin?

๐Ÿค– Android First-Class

Google's preferred language for Android development with modern tools and libraries.

๐ŸŒ Multiplatform

Share code between Android, iOS, web, and desktop from a single codebase.

โ˜• Java Interop

100% interoperable with Java. Use existing libraries and gradually migrate.

โšก Modern & Concise

Null safety, coroutines, extension functions, and more with less boilerplate.

What Can You Build?

Android Development

Google's preferred language, modern UI toolkit, seamless Java interop

Frameworks:

Jetpack ComposeAndroid SDKHiltRoom

Examples:

  • Native Android apps
  • Wear OS apps
  • Android TV
  • Automotive apps

Multiplatform

Share code across platforms, native performance, single codebase

Frameworks:

KMMCompose MultiplatformKtorSQLDelight

Examples:

  • iOS/Android shared code
  • Desktop apps
  • Web frontends
  • Server apps

Backend Development

Coroutines for async, type safety, Java ecosystem access

Frameworks:

KtorSpring BootExposedkotlinx.serialization

Examples:

  • REST APIs
  • Microservices
  • GraphQL servers
  • Real-time apps

Desktop Applications

Native desktop apps, modern UI, cross-platform deployment

Frameworks:

Compose DesktopTornadoFXJavaFXSwing

Examples:

  • Developer tools
  • Business apps
  • Media editors
  • Games

Natural Language Examples

Describe your Kotlin project in plain English:

"Create a Kotlin Android app with Jetpack Compose and Material 3 design"
โ†’

Modern Android app with declarative UI

"Build a Kotlin multiplatform project sharing logic between iOS and Android"
โ†’

Cross-platform mobile app with shared business logic

"Design a Kotlin backend API with Ktor, coroutines, and PostgreSQL"
โ†’

Async web service with database integration

Kotlin Best Practices

Kotlin Idioms

  • Use data classes for DTOs
  • Leverage null safety
  • Prefer immutability
  • Use scope functions wisely

Coroutines

  • Structured concurrency
  • Use appropriate dispatchers
  • Handle cancellation
  • Avoid blocking calls

Android Specific

  • Follow MVVM pattern
  • Use Jetpack libraries
  • Implement proper lifecycle
  • Test with Espresso

Code Quality

  • Extension functions over utils
  • Sealed classes for state
  • Inline classes for types
  • Use contracts for smart casts

Quick Start Templates

๐Ÿ“ฑ Android App

Modern Android app with Jetpack Compose UI

"Create a Kotlin note-taking app with Room DB"

๐Ÿ”„ Multiplatform

Shared code for iOS and Android apps

"Build a Kotlin multiplatform weather app"

๐ŸŒ Backend API

REST API with Ktor and coroutines

"Design a Kotlin chat server with WebSockets"

๐Ÿ–ฅ๏ธ Desktop App

Cross-platform desktop with Compose

"Create a Kotlin password manager app"

Pro Tips

๐ŸŽจ Compose Everything

Use Jetpack Compose for Android UI - it's the future of Android development

๐Ÿ”„ Coroutines First

Master coroutines for async programming - they're easier than threads

๐Ÿ“ฑ KMM for Mobile

Use Kotlin Multiplatform Mobile to share code between iOS and Android

๐Ÿงช Test Everything

Use JUnit 5 with MockK for unit tests and Espresso for UI tests