You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.4 KiB

# Development for Android
## What is covered
This tutorial covers topic of using Compose Multiplatform for multiplatform build that includes Android
## Intro
3 years ago
Compose Multiplatform build doesn't contain any Android artifacts.
3 years ago
Instead it references Jetpack Compose Android artifacts [published by Google](https://developer.android.com/jetpack/compose).
3 years ago
This way we ensure that libraries built for Android using Jetpack libraries are compatible with Compose Multiplatform.
## Usage
3 years ago
Jetpack Compose interoperability is enabled on the publication level - nothing needs to be explicitly enabled.
3 years ago
3 years ago
The easiest way to start is to use Kotlin Project Wizard with Compose Multiplatform template - one of the target platform is Android.
3 years ago
To see how it could be achieved see the [multiplatform template](https://github.com/JetBrains/compose-multiplatform/tree/master/templates/multiplatform-template).
## Versioning
Compose Multiplatform `1.1.1` references Jetpack Compose `1.1.0`. If one wants to use a different version, they could explicitly
3 years ago
override Jetpack Compose dependencies to the Android module (or to the androidMain sourceset in MPP module) like this:
3 years ago
3 years ago
``` kotlin
3 years ago
dependencies {
implementation("androidx.compose.material:material:1.2.0-beta01")
3 years ago
}
```
3 years ago
## Useful reading about porting Android apps to Desktop
[Porting ViewModel](https://github.com/JetBrains/compose-multiplatform/discussions/1587)