Kotlin Multiplatform by Tutorials: Build Native Apps Faster by Sharing Code Across Platforms
- Length: 485 pages
- Edition: 1
- Language: English
- Publisher: Razeware LLC
- Publication Date: 2022-03-15
- ISBN-10: 1950325628
- ISBN-13: 9781950325627
- Sales Rank: #1229352 (See Top 100 Books)
Learn how to use Kotlin to share code across platforms
Mobile developers have to often repeat the same code across multiple platforms, which is not only time-consuming but also error-prone. Most documentation targets only specific use cases but misses out on the nuances essential to sharing code effectively across platforms.
Kotlin Multiplatform by Tutorials will help you efficiently implement real-world apps for different platforms by sharing common code.
Who this book is for
This book is for mobile developers and managers who want to explore how they can use Kotlin Multiplatform to share code across Android, iOS and desktop apps. If you want to reduce development and testing time by writing certain parts of your apps only once, this book will help.
Topics covered in Kotlin Multiplatform by Tutorials
- Jetpack Compose Android: Use Android’s latest UI toolkit to quickly spin up the UI for different screens of your Android app.
- Compose Multiplatform: Use the concepts you learned in Jetpack Compose Android to develop the UI for desktop apps.
- SwiftUI: Learn how to develop the UI for iOS and macOS apps entirely in Swift.
- Testing: Make your code reliable by writing tests for both common code as well as platform-specific code.
- Koin: Learn about dependency injection and how you can use Koin to implement dependency injection in multiplatform apps.
- SQLDelight: Create a common persistence layer for your multiplatform apps while also getting the benefits of compile-time safety for schemas, statements and migrations.
- Serialization: Learn about different serialization formats and how you can use them to parse JSON data fetched from the Internet.
- Ktor: Implement a common networking layer with support for platform-specific HTTP clients.
- Coroutines: Learn about structures concurrency and the considerations to keep in mind while using coroutines on different platforms.
One thing you can count on: after reading this book, you’ll be prepared to create modules where you can write your code only once but target multiple platforms.
What You Need Book Source Code & Forums Dedications About the Team About the Authors About the Editors Introduction How to read this book Chapter 1: Introduction What is Kotlin Multiplatform? Setting up your environment Creating your first project Key points Where to go from here? Chapter 2: Getting Started Getting to know Gradle BuildSrc Shared build file Android build file Find Time Business logic Challenge Key points Where to go from here? Chapter 3: Developing UI: Android Jetpack Compose UI frameworks Jetpack Compose Time finder Time Zone screen Find Meeting Time screen Key points Where to go from here? Chapter 4: Developing UI: iOS SwiftUI Getting to know SwiftUI Key points Where to go from here? Chapter 5: Developing UI: Compose Multiplatform Getting to know Compose Multiplatform Creating a desktop app Shared UI Key points Where to go from here? Chapter 6: Connect to Platform-Specific API Reusing code between platforms Say hello to Organize Updating the Platform class Updating the UI Challenge Key points Chapter 7: App Architecture Design patterns Sharing business logic Creating Reminders section Sharing tests and UI Challenge Key points Chapter 8: Testing Setting up the dependencies Writing tests for RemindersViewModel Writing tests for Platform UI tests Challenge Key points Where to go from here? Chapter 9: Dependency Injection Advantages of dependency injection Automated DI vs. manual DI Setting up Koin Using Koin in each platform Updating AboutViewModel Testing Key points Where to go from here? Chapter 10: Data Persistence Key-Value storage Database Challenge Key points Where to go from here? Chapter 11: Serialization The need for serialization Project overview Application features Adding serialization to your Gradle configuration Different serialization formats Creating a custom serializer Serializing/deserializing new data Serializable vs. Parcelable Implementing Parcelize in KMP Testing Challenges Key points Where to go from here? Chapter 12: Networking The need for a common networking library Using Ktor Adding Ktor Connecting to the API with Ktor Plugins Retrieving content Adding headers to your request Uploading files Testing Challenge Challenge: Send your package name in a request header Key points Where to go from here? Chapter 13: Concurrency The need for structured concurrency Understanding kotlinx.coroutines Structured concurrency in iOS Using kotlinx.coroutines Working with kotlinx.coroutines New Kotlin/Native memory model Challenge Key points Where to go from here? Chapter 14: Creating Your KMP Library Migrating an existing feature to Multiplatform Publishing your KMP library Challenges Key points Where to go from here? Chapter 15: Conclusion Appendix A: Kotlin: A Primer for Swift Developers Kotlin and Swift: Comparing both languages Kotlin and Swift syntax table Where to go from here? Appendix B: Debugging Your Shared Code From Xcode Debugging the shared module Where to go from here? Appendix C: Sharing Your Compose UI Between Android & Desktop Updating your project structure Sharing your UI code Migrating Your Android UI code to multiplatform Compose Multiplatform Using third-party libraries Handling resources What’s missing? Where to go from here?
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.