Kotlin Multiplatform by Tutorials | Kodeco

This book is for mobile developers and managers who want to explore how they can use Kotlin Multiplatform in different use cases to share code in Android, iOS and desktop apps. If you want to reduce development and testing time by writing some parts of your apps only once, this book will help.

  • Jetpack Compose Android
  • Create Multiplatform
  • SwiftUI
  • Trial
  • Dependency Injection with Koin
  • Continue with SQLDelight
  • serializations
  • Ktor
  • Concurrency using coroutines

The best book to teach you how to share code across platforms using Kotlin Multiplatform. You’ll get the foundation to build user interfaces using native UI toolkits and then write common code for serialization, networking and persistence. You will also learn how dependency injection, testing and different architectures are compatible with…


more

This section tells you some things you need to know before you start, such as what you need for hardware and software, where to find the project files for this book, and so on.

One of the main benefits of Kotlin Multiplatform is that you can share code with native apps. You can continue developing the UI layer using native UI toolkits such as Jetpack Compose for Android and SwiftUI for iOS.

In this section, you will learn how to add a new Gradle module to write your business logic just once. You’ll also learn how to create native UIs for Android, iOS and desktop apps, all while sharing a common module.

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

Having reliable build tools and consistent dependency versions is essential when starting a multiplatform project. This chapter will cover how you can use Gradle and its buildSrc module to provide dependencies for all modules. You will also learn how to share business logic across target platforms using a multiplatform time zone library.

Jetpack Compose is a new declarative library aimed at simplifying Android UI development. This chapter will walk you through creating multiple screens for your app using Jetpack Compose.

SwiftUI is the modern way to program UI for iOS applications. In this chapter, you will learn how to develop UI for iOS using the SwiftUI framework.

It is now possible to share the same UI code across desktop and Android applications. In this chapter, you will learn how to develop UI for the desktop using the new Compose Multiplatform declarative library.

To effectively share code with apps, there are several things to keep in mind: access to platform-specific APIs, support for existing software engineering practices and maintainability.

In this section, you’ll learn how to use Kotlin features to access platform-specific APIs in your shared module and how Kotlin Multiplatform fits into your current architecture. You will also learn about dependency injection and how you can use it to test features that are in your shared modules. Finally, you will learn how to use a common codebase to manage maintenance on different platforms.

When working with KMP, you often need to access platform-specific APIs. In this chapter, you’ll examine the expected/actual pattern and how you can use it to access platform-specific APIs.

Software architecture is one of the most important aspects that affect quality and maintainability over time. In this chapter, you will get an overview of different architectures and how you can use one of them in your KMP application.

Writing tests is an essential part of writing code confidently. This chapter will provide an overview of adding unit tests and UI tests to an app built using KMP.

Dependency Injection is a technique that leads to maintainable and testable code. This chapter will provide an overview of integrating the Koin dependency injection library into a multiplatform project.

Most modern applications need to persist data across sessions. This chapter will provide an overview of KMP data maintenance. It discusses key value storage as well as SQL database usage.

Networking is essential to most modern apps, and often involves implementing similar logic using different frameworks and languages. Under the hood, it also involves concepts like serialization and concurrency. Fortunately, Kotlin Multiplatform has dedicated libraries for each of these.

In this section, you will learn how to use serialization to decode JSON data into Kotlin objects. You will learn how to use a common networking library that uses this common serialization to retrieve data from the internet. To make networking performant, you will also learn about concurrency in Kotlin using coroutines and the considerations for different platforms. Finally, you will learn how to take an existing part of a Kotlin Multiplatform library and also different ways to publish this library.

When sending data over a network, you need to serialize and deserialize it. In this chapter, you will learn how to use serialization in a Kotlin Multiplatform project.

Networking is one of the core features of any modern app. In this chapter, you will learn how to use networking in a Kotlin Multiplatform project.

In this chapter, you will learn how to deal with concurrency in your Kotlin Multiplatform projects.

In this chapter, you will learn how you can migrate existing features to KMP. You also learn how to publish a shared library and make it available for Android, iOS and desktop.

In this chapter, you will learn about several Kotlin tools and their comparison with Swift.

Xcode does not support debugging Kotlin Native code out of the box. In this chapter, you will learn how to debug your shared code module from Xcode.

In this chapter, you’ll learn how you can share your Compose UI between Android, desktop, and iOS apps.

Leave a comment