Helion


Szczegóły ebooka

Simplifying Application Development with Kotlin Multiplatform Mobile

Simplifying Application Development with Kotlin Multiplatform Mobile


Sharing code between platforms can help developers gain a competitive edge, and Kotlin Multiplatform Mobile (KMM) offers a sensible way to do it. KMM helps mobile teams share code between Android and iOS in a flexible way, leaving room for native development.

The book begins by helping you to gain a clear understanding of the Kotlin Multiplatform approach, how it works, and how it is different from cross-platform technologies, such as React Native and Flutter, and code sharing options, such as C++. You'll then see how your team can use this software development kit (SDK) to build native applications more effectively by learning timeless concepts and working through practical examples. As you advance, you'll get to grips with the core concepts, understand why UI sharing fails, and get hands-on with developing a small KMM application. Finally, you'll discover expert tips and best practices, along with production- and adoption-related questions, that will help you take the next step in your project and career.

By the end of this Kotlin book, you'll have gained a solid understanding of the capabilities of KMM and be able to share code between Android and iOS flexibly.

  • Simplifying Application Development with Kotlin Multiplatform Mobile
  • Contributors
  • About the author
  • About the reviewers
  • Preface
    • Who this book is for
    • What this book covers
    • To get the most out of this book
    • Download the example code files
    • Download the color images
    • Conventions used
    • Get in touch
    • Share Your Thoughts
  • Section 1 - Getting Started with Multiplatform Mobile Development Using Kotlin
  • Chapter 1: The Battle Between Native, Cross-Platform, and Multiplatform
    • Understanding the compounding costs of native development
      • The cost of native app development
      • Synchronization
    • Exploring the pitfalls of cross-platform solutions
      • Assumed cross-platform development costs
      • Actual cross-platform technology costs
    • Adopting a multiplatform approach
      • The multiplatform approach
      • How KMP works
      • Platform abstractions (expect-actual)
      • The different use cases for KMP
      • KMM cost implications
    • Summary
  • Chapter 2: Exploring the Three Compilers of Kotlin Multiplatform
    • Kotlin compilers in general
    • The Kotlin/JVM compiler
      • How it works
      • Executing Java code on Android
    • The Kotlin/Native compiler
      • How it works
      • Interoperability on iOS
      • The concurrency model
      • Annotation processing
      • Intermediate source sets and the Commonizer
    • The Kotlin/JS compiler
      • How it works
    • Summary
  • Chapter 3: Introducing Kotlin for Swift Developers
    • Technical requirements
    • Introducing Gradle
      • Structure of Gradle
    • Exploring Kotlins core features
      • Null safety
      • Data classes
      • Extensions
      • Functional programming features
      • Objects
      • COW in Kotlin
    • Understanding Kotlin coroutines
      • Suspend functions
      • CoroutineScope
      • Executing coroutines
      • Switching threads
      • Streams in Kotlin
    • Summary
  • Section 2 - Code Sharing between Android and iOS
  • Chapter 4: Introducing the KMM Learning Project
    • Technical requirements
    • Getting to know our project Dogify
    • Exploring prerequisites
      • Skill requirements
      • Required tools
    • Understanding the technical decisions
      • Architecture
      • The shared code
      • Library choices
    • Summary
  • Chapter 5: Writing Shared Code
    • Technical requirements
    • Initial project setup
      • Project structure
    • Fetching data from the Dog API
    • Persisting data in a local database
      • Exploring how to set up SQLDelight in a multiplatform module
      • Implementing the BreedsLocalSource
      • Connecting our database to the rest of the components
    • Summary
  • Chapter 6: Writing the Android Consumer App
    • Technical requirements
    • Setting up the Android module
      • Enabling Jetpack Compose
      • Adding the necessary dependencies
    • Tying the Android app to the shared code
    • Implementing the UI on Android
    • Summary
  • Chapter 7: Writing an iOS Consumer App
    • Technical requirements
    • Setting up the iOS app
    • Tying the iOS app together with the shared code
    • Implementing the UI on iOS
    • Summary
  • Section 3 - Supercharging Yourself for the Next Steps
  • Chapter 8: Exploring Tips and Best Practices
    • Technical requirements
    • Testing shared code
    • Architectural decisions
      • Interacting with coroutines
      • Interacting with data transfer objects (DTOs)
      • Interacting with shared code
    • Managing concurrency
      • New memory manager
    • App size best practices
    • Summary
  • Chapter 9: Integrating KMM into Existing Android and iOS Apps
    • Deciding on a mono repository or a shared library
      • Mono repository
      • Multiple repositories
      • Conclusion
    • Exploring team structure and tooling
      • Team structure
      • Tooling
    • Learning some adoption tips
    • Summary
  • Chapter 10: Summary and Your Next Steps
    • Recapitulating what you have learned
    • Managing your KMP expectations
      • Will it change the mobile development landscape?
      • Kotlin/Native's direct interoperability with Swift
      • Shared UI
    • Learning resources
    • Summary
    • Why subscribe?
  • Other Books You May Enjoy
    • Packt is searching for authors like you
    • Share Your Thoughts

  • Tytuły: Simplifying Application Development with Kotlin Multiplatform Mobile
  • Autor: Róbert Nagy
  • Tytuł oryginału: Simplifying Application Development with Kotlin Multiplatform Mobile
  • ISBN Ebooka: 9781801819657, 9781801819657
  • Data wydania: 2022-03-04
  • Identyfikator pozycji: e_2t48
  • Kategorie:
  • Wydawca: Packt Publishing