can be deployed across multiple platforms (Android, iOS, Web, Desktop) without rewriting code for each platform. • Benefits of cross-platform development include: ◦ Code Reusability. ◦ Faster Development Cycles. ◦ Consistency across platforms. ◦ Reduced Development Cost. • Popular cross-platform frameworks/tools include; React Native, Xamarin, Flutter etc.
framework from JetBrains that allows developers to share code across multiple platforms (Android, iOS, web, desktop). • It provides the ability to write common code for business logic, data models, and backend communication, while still allowing platform-specific code where necessary. • Benefits of kotlin multiplatform include: ◦ Increased code reusability. ◦ Faster development cycles. ◦ Freedom to go native.
new Kotlin Multiplatform project is by using JetBrains' KMP Wizard. • Jetbrains’ KMP Wizard is an online tool that guides developers through the setup of a new KMP project by generating the necessary project structure, configuration files, and basic platform-specific modules.
iOS, desktop, or JavaScript) that your shared code will be compiled to. • Kotlin Multiplatform currently offers supports the following target platforms: ◦ Android ◦ iOS ◦ Desktop (Linux, MacOS, Windows) ◦ Web/JS
which is a dedicated module that holds platform-independent code, allowing it to be reused across various target platforms. • The shared module includes several key packages, such as: ◦ commonMain ◦ commonTest ◦ targetMain eg. androidMain, iosMain, desktopMain, jsMain etc.
used to handle platform-specific code. - expect keyword is used in the shared module to declare a common API or class without providing an implementation. - actual keyword is used in the platform-specific modules (e.g., Android, iOS) to provide the concrete implementation for each target platform
gradually instead of a complete overhaul. This approach allows for easier testing and integration. - Greenfield Approach: For new projects, consider starting directly with KMP to leverage its capabilities from the ground up.