Table of Contents

Kotlin Multiplatform

Return to Kotlin Native, brew install kotlin-native, Kotlin, xcode-kotlin, kotlinc, Kotlin Installation, brew install, Cloud Monk's Development PC DevOps Automation via Ansible-Chocolatey-PowerShell-Homebrew-DNF-APT, choco install kotlin

Formerly called: Kotlin Native

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

The Kotlin Multiplatform technology is designed to simplify the development of cross-platform projects. It reduces time spent writing and maintaining the same code for different platforms while retaining the flexibility and benefits of native programming. Kotlin Multiplatform use cases Android and iOS applications

Sharing code between mobile platforms is one of the major Kotlin Multiplatform use cases. With Kotlin Multiplatform Mobile, you can build cross-platform mobile applications and share common code between Android and iOS, such as business logic, connectivity, and more.

Check out the Get started with Kotlin Multiplatform Mobile and Create a multiplatform app using Ktor and SQLDelight tutorials, where you will create applications for Android and iOS that include a module with shared code for both platforms. Full-stack web applications

Another scenario when code sharing may bring benefits is a connected application where the logic can be reused on both the server and the client side running in the browser. This is covered by Kotlin Multiplatform as well.

See Build a full-stack web app with Kotlin Multiplatform tutorial, where you will create a connected application consisting of a server part, using Kotlin/JVM and a web client, using Kotlin/JS. Multiplatform libraries

Kotlin Multiplatform is also useful for library authors. You can create a multiplatform library with common code and its platform-specific implementations for JVM, JS, and Native platforms. Once published, a multiplatform library can be used in other cross-platform projects as a dependency.

See the Create and publish a multiplatform library tutorial, where you will create a multiplatform library, test it, and publish it to Maven. Common code for mobile and web applications

One more popular case for using Kotlin Multiplatform is sharing the same code across Android, iOS, and web apps. It reduces the amount of business logic coded by frontend developers and helps implement products more efficiently, decreasing the coding and testing efforts.

See the RSS Reader sample project — a cross-platform application for iOS and Android with desktop and web clients implemented as experimental features. How Kotlin Multiplatform works Kotlin Multiplatform

   Common Kotlin includes the language, core libraries, and basic tools. Code written in common Kotlin works everywhere on all platforms.
   With Kotlin Multiplatform libraries, you can reuse the multiplatform logic in common and platform-specific code. Common code can rely on a set of libraries that cover everyday tasks such as HTTP, serialization, and managing coroutines.
   To interop with platforms, use platform-specific versions of Kotlin. Platform-specific versions of Kotlin (Kotlin/JVM, Kotlin/JS, Kotlin/Native) include extensions to the Kotlin language, and platform-specific libraries and tools.
   Through these platforms you can access the platform native code (JVM, JS, and Native) and leverage all native capabilities.

Code sharing between platforms

With Kotlin Multiplatform, spend less time on writing and maintaining the same code for different platforms – just share it using the mechanisms Kotlin provides:

   Share code among all platforms used in your project. Use it for sharing the common business logic that applies to all platforms.
   Share code among some platforms included in your project but not all. Do this when you can reuse much of the code in similar platforms:
   Code shared for iOS targets
   If you need to access platform-specific APIs from the shared code, use the Kotlin mechanism of expected and actual declarations.
   
   

macOS

See: brew install kotlin-native

Linux

See: brew install kotlin-native

Kotlin: Kotlin Fundamentals, Kotlin Inventor - Kotlin Language Designer: Andrey Breslav and JetBrains on July 22, 2011, Kotlin 1.0 on February 15, 2016; JVM, Kotlin on JVM, Kotlin RFCs, Kotlin Scripting, Kotlin Keywords, Kotlin Built-In Data Types, Kotlin Data Structures - Kotlin Algorithms, Kotlin Syntax, Kotlin OOP - Kotlin Design Patterns - Kotlin Best Practices, Kotlin Installation, Kotlin Containerization, Kotlin Configuration, Kotlin Compiler, Kotlin Transpiler (Kotlin/JS - Kotlin.js, kotlin.multiplatform), Kotlin Multiplatform, Kotlin REPL (Kotlin Interpreter), Kotlin IDEs (JetBrains IntelliJ, Android Studio), Kotlin development tools, Kotlin Linter, JetBrains, Kotlin Testing, Kotlin on Android, Kotlin on Windows, Kotlin on macOS, Kotlin on Linux, KTor, Kotlin DevOps - Kotlin SRE - Kotlin Scripting (kscript), Kotlin Data Science - Kotlin DataOps, Kotlin Machine Learning, Kotlin Deep Learning, Functional Kotlin, Kotlin Concurrency - Kotlin Parallel Programming - Async Kotlin, Kotlin History, Kotlin Bibliography, Manning Kotlin Series, Kotlin Glossary, Kotlin Topics, Kotlin Courses, Kotlin Security - Kotlin DevSecOps, Kotlin Standard Library, Kotlin Libraries, Kotlin Frameworks, Kotlin Research, Kotlin GitHub, Written in Kotlin, Kotlin Popularity, Kotlin Awesome List, Kotlin Versions. (navbar_kotlin)


Kotlin Package Manager, Kotlin Virtualization, Kotlin Interpreter, Kotlin REPL, Kotlin IDEs (IntelliJ - CLion, Visual Studio Code), Kotlin Development Tools, Kotlin Linter, Kotlinaceans-Kotlin User, Kotlin Uses, List of Kotlin Software, Kotlin Popularity, Kotlin Compiler, Kotlin Transpiler, Kotlin DevOps - Kotlin SRE, Kotlin Data Science - Kotlin DataOps, Kotlin Machine Learning, Kotlin Deep Learning, Functional Kotlin, Kotlin Concurrency - Kotlin Parallel Programming - Async Kotlin, Kotlin Standard Library, Kotlin Testing, Kotlin Libraries, Kotlin Frameworks, Kotlin History, Kotlin Bibliography, Kotlin Glossary - Kotlin Official Glossary, Kotlin Topics, Kotlin Courses, Kotlin Research, Kotlin GitHub, Written in Kotlin, Kotlin Awesome List. (navbar_Kotlin)

Homebrew: Cloud Monk's Package Manager Book Homebrew Chapter, Cloud Monk's Development PC DevOps Automation via Ansible-Chocolatey-PowerShell-Homebrew-DNF-APT, Homebrew Glossary, Homebrew Fundamentals, Homebrew Inventor - Homebrew Designer: Mike McQuaid, Brew DevOps - Homebrew on macOS - macOS DevOps - MacOps, Homebrew on Linux - Linux DevOps - LinuxOps, Homebrew Automation, Idempotent, Refreshenv, Homebrew Topics, macOS Package Managers, Package managers, macOS Configuration Management, PowerShell on macOS Ansible on macOS, Chef on macOS, Puppet on macOS (navbar_brew - see also navbar_choco, navbar_package_manager)


© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.