Preface

Kotlin Multiplatform is the new tool in the toolkit of native developers. It provides gradual code-sharing capabilities between multiple platforms, including Android and iOS.

This book introduces this new technology from the perspective of mobile development. It gives you the necessary knowledge to extend your development toolset and build a more effective native development process.

After reading this book, you should have a clear understanding of Kotlin Multiplatform's strengths and how you can leverage the tool to build mobile applications more effectively.

Who this book is for

This book is for native Android and iOS developers who want to build high-quality apps using an efficient development process. Knowledge of the framework and the languages used is necessary, that is, Android with Java or Kotlin and iOS with Objective-C or Swift. For Swift developers, the book assumes no knowledge of Kotlin as this will be covered in the context of Swift.

What this book covers

Chapter 1, The Battle Between Native, Cross-Platform, and Multiplatform, compares the available cross-platform frameworks with native frameworks and introduces Kotlin Multiplatform.

Chapter 2, Exploring the Three Compilers of Kotlin Multiplatform, describes the architecture of Kotlin Multiplatform and how it solves code sharing between different platforms.

Chapter 3, Introducing Kotlin for Swift Developers, provides a brief introduction to Kotlin, to bring everyone up to speed before the learning project.

Chapter 4, Introducing the KMM Learning Project, describes the learning project and its prerequisites.

Chapter 5, Writing Shared Code, gives you practical advice on writing shared code with Kotlin Multiplatform.

Chapter 6, Writing the Android Consumer App, explains how the shared code written previously can be consumed on Android.

Chapter 7, Writing an iOS Consumer App, explains how the shared code written previously can be consumed on iOS.

Chapter 8, Exploring Tips and Best Practices, dives deeper into the current state of the art of writing shared code with Kotlin Multiplatform.

Chapter 9, Integrating KMM into Existing Android and iOS Apps, provides tips and answers to possible questions regarding the integration of KMM into existing production apps.

Chapter 10, Summary and Your Next Steps, points you in the next direction in terms of consolidating your KMM knowledge.

To get the most out of this book

You should have basic programming skills, such as familiarity with Object-Oriented Programming (OOP), asynchronous programming, and the general concepts used in mobile development.

Familiarity with Kotlin and Android-related tools (Gradle) is not required as there is a quickstart chapter to bring everyone up to speed on what's needed to start coding the example project.

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book's GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Simplifying-Application-Development-with-Kotlin-Multiplatform-Mobile. If there's an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots and diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781801812580_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in the text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "For every Gradle module/project, you'll have a build.gradle (or .kts) file describing the build steps for that specific module."

A block of code is set as follows:

plugins {

    kotlin("multiplatform")

    id("com.android.library")

    kotlin("plugin.serialization") version

      Versions.KOTLIN_VERSION

    id("org.jetbrains.kotlin.native.cocoapods")

}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

// Swift unwrapping

if let string = optional {

    print(string.count)

} else {

    print("I'm nil")

}

Any command-line input or output is written as follows:

$ mkdir css

$ cd css

Bold: Indicates a new term, an important word, or words that you see on screen. For instance, words in menus or dialog boxes appear in bold. Here is an example: "Open the Android Studio New Project wizard (Android Studio | New Project). From the Phone and Tablet tab, select KMM Application."

Tips or Important Notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at [email protected] and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you've read Simplifying Application Development with Kotlin Multiplatform Mobile, we'd love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we're delivering excellent quality content.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.8.216