Set up an environment for KMM development
What is KMM
The purpose of the Kotlin Multiplatform Mobile (KMM) technology is to unify the development of applications with common logic for Android and iOS platforms
KMM project consists of three components
- Android application
- Ios application
- Shared module — common logic for both android application and ios application. Also run android and ios framework.
Set up
Open android studio
Navigate to Preferences -> Plugins and search for Kotlin Multiplatform Mobile and install it.
Now Restart Android Studio
Creating KMM Project
In Android studio, File -> New -> New project -> Select KMM Application -> Click to next
Set up Name and Package Name and Project location -> click to next
Click finish and wait for downloading gradle dependencies.
Now project set up the finish
We can now see that the android and ios and shared folder.
Shared module contains the core application logic used in both target platforms: classes, functions, and so on. This is a module that compiles into an Android library and an iOS framework. It uses Gradle with the Kotlin Multiplatform plugin applied and has targets for Android and iOS.
Now we can successfully run our application on android and ios device
find more details
KMM sample app also available on Github