Written by Márton BraunDeveloper Relations Engineer
Kotlin Multiplatform Mobile by JetBrains has now entered beta. We have been testing this technology in order to determine if it allows code sharing between platforms. In Jetpack, you can now see a preview Kotlin Multiplatform library.
DataStore and Collections will both be made available to multiplatform users as an experimental preview. Because they assess several key aspects of changing an existing library to multiplatform, these libraries were chosen.
- The Java programming language has not yet created Collections, a collection that is written in Java. AndroidJava collection APIs are implemented, but -specific dependencies.
- DataStore was written in Kotlin and uses coroutines for both implementation and APIs. Java IO is also required. Android Platform APIs
With this preview, we’re looking for your feedback about using these Jetpack libraries in multiplatform projects targeting Android iOS apps. Remember that the following applications can be used for iOS and Android.
Dev These builds should be considered experimental. It is not They can be used in production. These publications are released outside of the normal release cycles and are not guaranteed that they will graduate to stable.
The libraries are available from Google’s Maven repository. Add the following dependencies in your Kotlin Multiplatform program to begin using them.Get val CommonMain
Check out this sample app that uses DataStore to learn more about available APIs Android iOS or the preview API reference document available for both libraries.
You can join the Kotlinlang #multiplatform conversation to give feedback and show interest in Kotlin Multiplatform. Also, you can open bug reports on the Issue Tracker for DataStore and for Collections.
*Java is a trademark or registered trademark of Oracle and/or its affiliates.