Kotlin Multiplatform (KMP)

Programming cross Platform Applications with Kotlin Multiplatform (KMP)

KotlinKMP

All developers have to make a decision when they start programming. Which Programming language to choose from. Which is the ultimate framework to build a plattform and bring it to a big variety of users.

Kotlin Multiplattform allows to create apps for Android, IOS,Web and Desktop. What are the pros and cons of this programming environment?

ProsCons
Effortless Simulator Testing: On IOS,Android, Web and Desktop.Still requires Mac for iOS testing and deployment
Performance: Near-native performance with shared business logicPlatform-Specific Code: Still need native code for platform-specific features
Single Language: Use Kotlin for all platformsLearning Curve: Requires understanding of multiple platform architectures
JetBrains Support: Strong backing from JetBrains with regular updatesDebugging Complexity: Cross-platform debugging can be more challenging
Gradual Adoption: Can be adopted incrementally in existing projectsSimultaneous testing: Running 4 simulators at the same time are not possible on my 6 year old mac.

Notes

Getting started:

What is Gradle?

  • The package manager

How is the User Interface created?

UI Framework = Compose Multiplatform?

What are modifiers? https://medium.com/@serhiihulenko/kmp-compose-modifier-b2cbbafaaa83

What are Lambdas?

https://kotlinlang.org/docs/lambdas.html

How to change icon?

https://medium.com/@hunterfreas/changing-app-icon-in-kotlin-multiplatform-7b615568cd26 https://proandroiddev.com/building-deploying-a-simple-kmm-app-part-1-app-icons-8e8b739c7981

Steps to Open and Run the KMP App on iOS

  1. Find the Xcode project file: Navigate to the iosApp folder in your Android Studio project's file structure. Within this folder you will find the file iosApp.xcodeproj.
  2. Open the project in Xcode: Right-click on the iosApp.xcodeproj file and select "Open in → Xcode".

Kotlin Basics

Follow the coding conventions:

https://kotlinlang.org/docs/coding-conventions.html