Unique cross-platform mobile development - Kotlin Multiplatform Mobile

foreword

For mobile development, cross-platform is an unavoidable topic.

In terms of cross-platform mobile technology selection, the two most popular are React Native and Flutter.

Both approaches have their own advantages and disadvantages. Whether it is React Native or Flutter for cross-platform mobile development is a difficult choice for the public.

Of course, my article is not to compare these two technologies, but to introduce another mobile cross-platform technology choice – KMM

insert image description here

What is KMM

The full name of KMM is: Kotlin Multiplatform Mobile, which is a product of jetbrains. It is a business cross-platform mobile development framework.

On KMM's official website, its most concise introduction to itself is:

Share the logic of your iOS and Android apps while keeping the UX native

To understand in Chinese is:

Different platforms share business logic while maintaining their native UI implementations

Advantages of KMMs

Compared with other cross-platform solutions, such as RN and Flutter, KMM has the following advantages:

1. There is no need to build multiple sets of engines (runtimes), and the package volume increment is smaller.

2. For Android developers, there is no need to learn a set of programming languages ​​and programming ideas, and the threshold is lower.

3. Based on the output of double-ended standard components, the risk of audit rejection is small (iOS).

4. Stronger interoperability, supports two-way interoperability with local programming languages, can directly use existing libraries, and avoids repeated construction of many basic components.

5. On the basis of maintaining native development, business modules can be reused.

How to learn KMM

Although the KMM framework has a very low threshold for Android developers, it can't stand the scattered, fragmented and incomplete blog articles on the Internet.

Therefore, the editor here spent a lot of time collecting and sorting out the knowledge points of the KMM framework into " KMM Cross-platform Framework Introduction Tutorial ", and shared this article with friends who are interested in the KMM framework for free. Friends in need can scan the QR code below to receive~

Chapter 1 Introduction and Basic Environment Construction

  • What are KMMs?
  • Relationship between Kotlin Multiplatforms
  • Simple comparison with other cross-platform frameworks
  • Run a KMM Demo
  • KMM project file structure

insert image description here

Chapter 2 Integrating KMM in Existing Projects

  • Why integrate in existing projects?
  • How to integrate KMM in an existing project

insert image description here

Chapter 3 Realization of Platform Differentiation

insert image description here

Chapter 4 Interacting with Dependent Libraries

  • Dependency Types for KMM
  • Use Common or Android dependencies
  • iOS dependencies

insert image description here

Chapter 5 Dealing with Multithreading

  • Why do you need to handle multithreading in KMM?
  • Feasible multi-thread switching method
  • KMM multithreading issues that need attention
  • Personally recommended asynchronous work implementation scheme

insert image description here

Chapter 6 Using SQLDelight to Operate the Database

  • The role of the database in the App
  • Introduction and Features of SQLDeilight
  • Processes developed using SQLDelight
  • Other usage suggestions and precautions

insert image description here

Chapter 7 Handling HTTP Network Requests

  • background
  • What is Ktor?
  • Configure Ktor for the KMM module
  • Create Ktor's HttpClient
  • Send a simple HTTP request
  • custom request
  • Handle the response
  • Other features of Ktor
  • KMM Network Capacity Building

insert image description here

Chapter 8 KMM cross-platform actual combat

  • Cross-end MVI framework - MVIKotlin
  • Failed Attempt to Port Jetpack Architecture Components
  • Deserialize SQLite database using kotlinx.serialization
  • Ctrip Air Ticket App KMM Cross-terminal KV repository MMKV-Kotlin

insert image description here

at last

I believe that this KMM framework learning material will definitely provide strong help and support for everyone in KMM learning, and become a real advanced Android cross-platform developer one step faster.

Guess you like

Origin blog.csdn.net/weixin_43440181/article/details/130563656