![]() Uno Platform lets you write an application once in XAML and C#, and deploy it to any target platform. New to Kotlin? Take a look at Getting started with Kotlin.Browse the set of available controls and their properties. Start with the Get started with Kotlin Multiplatform Mobile if you want to create iOS and Android applications with shared code Look through our examples and tutorials if you want to create applications or libraries targeting JVM, JavaScript, and other platforms If you need to access platform-specific APIs from the shared code, use the Kotlin mechanism of expected and actual declarations. Do this when you can reuse much of the code in similar platforms: Share code among some platforms included in your project but not all. Use it for sharing the common business logic that applies to all platforms. Share code among all platforms used in your project. With Kotlin Multiplatform, spend less time on writing and maintaining the same code for different platforms – just share it using the mechanisms Kotlin provides: Through these platforms you can access the platform native code (JVM, JS, and Native) and leverage all native capabilities. Platform-specific versions of Kotlin (Kotlin/JVM, Kotlin/JS, Kotlin/Native) include extensions to the Kotlin language, and platform-specific libraries and tools. To interop with platforms, use platform-specific versions of Kotlin. Common code can rely on a set of libraries that cover everyday tasks such as HTTP, serialization, and managing coroutines. With Kotlin Multiplatform libraries, you can reuse the multiplatform logic in common and platform-specific code. ![]() Code written in common Kotlin works everywhere on all platforms. How Kotlin Multiplatform worksĬommon Kotlin includes the language, core libraries, and basic tools. See the RSS Reader sample project - a cross-platform application for iOS and Android with desktop and web clients implemented as experimental features. It reduces the amount of business logic coded by frontend developers and helps implement products more efficiently, decreasing the coding and testing efforts. One more popular case for using Kotlin Multiplatform is sharing the same code across Android, iOS, and web apps. Common code for mobile and web applications See the Create and publish a multiplatform library tutorial, where you will create a multiplatform library, test it, and publish it to Maven. Once published, a multiplatform library can be used in other cross-platform projects as a dependency. You can create a multiplatform library with common code and its platform-specific implementations for JVM, JS, and Native platforms. Kotlin Multiplatform is also useful for library authors. 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. This is covered by Kotlin Multiplatform as well. Full-stack web applicationsĪnother 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. 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.Ĭheck out the Get started with Kotlin Multiplatform Mobile section and Kotlin Multiplatform Hands-on: Networking and Data Storage, where you will create an application for Android and iOS that includes a module with shared code for both platforms. Sharing code between mobile platforms is one of the major Kotlin Multiplatform use cases. Kotlin Multiplatform use cases Android and iOS applications It reduces time spent writing and maintaining the same code for different platforms while retaining the flexibility and benefits of native programming. Support for multiplatform programming is one of Kotlin's key benefits. Language features and tooling may change in future Kotlin versions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |