


Implementation(":kotlinx-coroutines-core:$coroutinesVersion") In the shared directory, specify the dependencies on all the required libraries in the file: To add a multiplatform library to the shared module, you need to add dependency instructions ( implementation) for all libraries to the dependencies block of the relevant source sets in the file.īoth the rialization and SQLDelight libraries also require additional configurations. Add dependencies to the multiplatform library You can find the configured project on the master branch. To view the complete structure of the multiplatform mobile project, switch the view from Android to Project.įor more on project features and how to use them, see Understand the project structure. Select Regular framework in the list of iOS framework distribution options. In the list of project templates, select Kotlin Multiplatform App and then click Next.

In Android Studio, select File | New | New Project. Search for the Kotlin Multiplatform Mobile plugin in the Android Studio Marketplace and install it.įor more details, see the Set up the environment section. You can find the template project as well as the source code of the final application on the corresponding GitHub repository. SQLDelight to generate Kotlin code from SQL queries and create a type-safe database API. rialization to deserialize JSON responses into objects of entity classes. Ktor as an HTTP client for retrieving data over the internet. You will use the following multiplatform libraries in the project: The output will be an app that retrieves data over the internet from the public SpaceX API, saves it in a local database, and displays a list of SpaceX rocket launches together with the launch date, results, and a detailed description of the launch: The business logic and data access layers will be implemented only once in the shared module, while the UI of both applications will be native.

The application will include a module with shared code for both the iOS and Android platforms. This tutorial demonstrates how to use Android Studio to create a mobile application for iOS and Android using Kotlin Multiplatform Mobile with Ktor and SQLDelight. Create a multiplatform app using Ktor and SQLDelight – tutorial
