Kotlin 多平台

    Support for multiplatform programming is one of Kotlin’s key benefits. It reduces time spent writing and maintaining the same code for while retaining the flexibility and benefits of native programming. Learn more about Kotlin Mutliplatform benefits.

    With Kotlin Multiplatform, share the code using the mechanisms Kotlin provides:

    • included in your project but not all. You can reuse much of the code in similar platforms using a hierarchical structure. You can use target shortcuts for common combinations of targets or .

    If you need to access platform-specific APIs from the shared code, use the Kotlin mechanism of expected and actual declarations.

    • teaches the concepts behind building an application that targets Kotlin/JVM and Kotlin/JS by building a client-server application that makes use of shared code, serialization, and other multiplatform paradigms. It also provides a brief introduction to working with Ktor both as a server- and client-side framework.