# Share code between Android and Jvm in Kotlin multiplatform

DevFeed: [Share code between Android and Jvm in Kotlin multiplatform](<https://devfeed.tech/articles/share-code-between-android-and-jvm-in-kotlin-multiplatform-28696.md>)

Original publisher: [Read original article](<https://jeroenmols.com/blog/2021/03/17/share-code-kotlin-multiplatform/>)

Author: info@jeroenmols.com (Jeroen Mols)

Published: 2021-03-17T00:00:00Z

Content type: tutorial

Language: en

Sources: [Jeroen Mols](<https://devfeed.tech/sources/jeroen-mols.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Android](<https://devfeed.tech/topics/android.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [blogs](<https://devfeed.tech/tags/blogs.md>), [code](<https://devfeed.tech/tags/code.md>), [code-sharing](<https://devfeed.tech/tags/code-sharing.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [intellij](<https://devfeed.tech/tags/intellij.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>)

## AI overview

This tutorial explains how to share code between Android and JVM targets in a Kotlin Multiplatform project when some APIs require platform-specific implementations. It presents two source-set approaches and discusses their effect on IntelliJ autocomplete.

## Source excerpt

While Android supports most Java language features, it doesn't support every API that Java provides. On the other hand, Kotlin multiplatform only allows sharing code across all targets (commonMain), not a subset of targets (commonJvm).