Filters

Hide filters
Platform
Content Type
Difficulty

All Tutorials · 23 Results

Contained in: Kotlin Multiplatform by Tutorials kotlin
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Introduction

Kotlin Multiplatform (KMP) is one of the latest technologies to help you share code across platforms. This chapter introduces you to KMP, how you can use it across app layers and how to set up your first KMP project…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Appendix A: Kotlin: A Primer for Swift Developers

…this chapter, you'll learn about several functionalities of Kotlin and their comparison with Swift…
Android & Kotlin New
Kotlin Multiplatform by Tutorials
…best book to teach you how to share code across platforms using Kotlin Multiplatform. You’ll gain the foundation of creating user interfaces using native UI toolkits and then writing common code for serialization, networking and persistence. You’ll also learn how dependency injection, testing and different architectures…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Getting Started

…complex process of building and managing projects by making use of the different plugins for almost any purpose. For KMP, you’ll use the Kotlin scripting version of Gradle. These files are named build.gradle.kts. The kts extension stands for “Kotlin script.” This version uses Kotlin for the Gradle DSL (Domain…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Serialization

…transmitting data over a network, you need to serialize and deserialize it. In this chapter, you'll learn how to use serialization in a Kotlin Multiplatform project…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Creating Your KMP Library

…develop a project that had a library already shared across different platforms. However, you may want to migrate an existing app to Kotlin Multiplatform. In this section, you’re going to see how a simple feature like opening a website link in a browser can easily be moved…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Developing UI: Compose Multiplatform

…shared module’s build file. Now, add the following: import org.jetbrains.compose.desktop.application.dsl.TargetFormat import org.jetbrains.kotlin.gradle.dsl.JvmTarget // 1 plugins { alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.compose.compiler) alias(libs.plugins.jetbrains.compose) } // 2 kotlin { // TODO: Add Kotlin } // 3 // TODO: Add Compose Desktop Here’s an explanation of the above code: Adds the Multiplatform and Desktop Compose plugins. It contains a TODO…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Connecting to Platform-Specific API

…wonderful if compilers could take the same code and produce formats that different platforms can understand. However, this is easier said than done. Kotlin Multiplatform takes this concept and promises to run essentially the same high-level code on multiple platforms — like JVM, JS or native platforms such…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Introduction

…your goal is to leverage Kotlin to share code among your native apps, this is the book for you. Maintaining multiple native apps with duplicated code can be a time-consuming process. This duplication also increases the testing effort, eventually slowing down the project and increasing costs…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Appendix C: Sharing Your Compose UI Across Multiple Platforms

Android, iOS and desktop apps. What if you could go a step further and also share your Compose UI? That’s right — along with Kotlin Multiplatform, you now have Compose Multiplatform, which allows you to share your Compose UI with Android, iOS and desktop apps. Note: This appendix uses learn…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Concurrency

…this chapter, you'll learn how to deal with concurrency in your Kotlin Multiplatform projects…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Testing

Whether you like it or not, having a good set of tests — both automated and manual — ensures the quality of your software. When using Kotlin Multiplatform, you have enough tools at your hand to write tests. So if you’re thinking of letting it slide this time, you’ll have…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Data Persistence

Room to KMP. Since this effort is relatively new, the KMP community has been using a fantastic library called SQLDelight. This library generates typesafe Kotlin APIs from your SQL statements and has a relatively straightforward setup. SQL SQL is a database querying language, and you shouldn’t mistake…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Appendix B: Debugging Your Shared Code From Xcode

Xcode doesn't support debugging Kotlin Native code out of the box. In this chapter, you'll learn how you can debug your shared code module from Xcode…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Dependency Injection

…project.dependencies.platform(libs.koin.bom)) implementation(libs.koin.core) Make sure to sync Gradle after adding all these dependencies. Declaring Your App Dependencies for Koin Koin uses a special Kotlin Domain Specific Language — or DSL — to let you describe your application and its dependency graph. There are three steps to start using Koin: Declare your…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Developing UI: Android Jetpack Compose

…used throughout the app. Start by creating a ui folder (or package) in the the com.kodeco.findtime.android folder. In the ui folder, create a new Kotlin file named Types.kt. Add the following: import androidx.compose.runtime.Composable // 1 typealias OnAddType = (List<String>) -> Unit // 2 typealias onDismissType = () -> Unit // 3 typealias composeFun…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Networking

Networking is one of the core features of any modern app. In this chapter, you'll lean how to use networking in a Kotlin Multiplatform project…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

App Architecture

…receives the changes automatically. People call this mechanism Data Binding, or simply Binding. Android developers are no strangers to using LiveData, or recently, Kotlin Flow or StateFlow, as the Binder inside ViewModel. After Apple introduced the Combine framework and SwiftUI as a first-party solution to reactive programming and declarative…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Developing UI: iOS SwiftUI

…previews so that you can build small components and view them next to the editor. Getting to Know SwiftUI Creating the project using the Kotlin Multiplatform Mobile plugin creates two Swift files: ContentView.swift and iOSApp.swift. These two files make up something like a ‘Hello World’ app. They show a text…
Android & Kotlin

Chapter in Kotlin Multiplatform by Tutorials

Conclusion

Congratulations! After a long journey, you’ve learned many important things about Kotlin Multiplatform and how you can leverage it to share code across native apps. You also learned how to develop UI on iOS, Android and desktop using the latest UI toolkits. Now you can apply what you learned…