Kotlin logo

Write the business logic for your iOS and Android apps with less time and effort – using nothing but Kotlin

Seamless integration with existing codebases

1An SDK, not a framework

Kotlin's philosophy is that you don't have to migrate the entire application. Start with a single module or feature, see how it goes, and then gradually move other parts as you see fit.

2Reuse your business logic

Use the Kotlin code you have already written, and modify it to be compatible with iOS. You’ll get less code and fewer bugs, and share domain knowledge between your iOS and Android developers.

3Smooth interoperability with platform-
specific code

Whenever a task cannot be solved in common code, use the expect/actual pattern to seamlessly write platform-specific code.

Cross-platform without the usual overhead

4Have a native UI

Kotlin does not impose any restrictions on how you develop your app’s UI. Its appearance, behavior, and performance all remain native.

5No lagging behind native platforms

Write platform-native logic and easily use it in your Kotlin code – don’t wait until vendors or the mobile community add support for new native features such as:

6Use the language you already know and love

Go cross-platform without introducing any new languages to your codebase.

Common

class APIClient {fun getUserInfo(userId: String): Userfun searchUsers(userName: String): List<User>}

Android

class SearchPresenter {val client = APIClient()fun findUsersByName(name: String): List<User> {val users = client.searchUsers(name)return users}}

iOS

class UserViewModel {let client = APIClient()func getUserAge(userId: String) -> Int {let user = client.getUserInfo(userId: userId)return user.age}}

Common

expect fun String.dateFormatToMilliseconds(format: String): Long

Android

actual fun String.dateFormatToMilliseconds(format: String): Long=SimpleDateFormat(format, Locale.getDefault()).parse(this).time

iOS

actual fun String.dateFormatToMilliseconds(format: String): Long {val formatter = NSDateFormatter()formatter.dateFormat = parseFormatreturn formatter.dateFromString(this)?.timeIntervalSince1970?.toLong()?: throw Exception("Failed, to parse $this for format $parseFormat")}

  • Dark mode
  • Sign in with Apple
  • Apple CryptoKit
  • CoreML 3
  • Dark theme
  • targetSdkVersion change
  • New privacy APIs
  • Gesture navigation

Common

data class Product(val name: String, val price: Int)fun List<Product>.checkOut() {val totalPrice = sumBy { it.price }val allPositions = joinToString(separator = " and ") { it.name }println("You've bought $allPositions for $totalPrice coins!")}

Teams that use Kotlin Mobile Multiplatform in production




Check out these live apps and libraries and see for yourself

APPS

LIBRARIES

Moko

Kotlin Multiplatform libraries for mobile (Android & iOS) development

Source

Korlibs

A set of modern Kotlin Common libraries for full-stack development

Source

Stately

State utility library to facilitate state management in Kotlin Multiplatform

Source

SQLDelight

Generates typesafe APIs from your SQL statements

Source

Splitties

Collection of small Kotlin Multiplatform libraries

Source

Multiplatform settings

Library for saving simple key-value data

Source

Kissme

Open-source library providing encrypted key-value storage

Source

Blue-Falcon

Bluetooth library for iOS and Android

Source

Try this Kotlin flavor

#kotlinmultiplatform

Share your feedback on Twitter or let us know when you build something cool!