A company with an Android app and an iOS app has two implementations of every pricing rule, every validation and every calculation. They are written by different people in different languages, and they drift. The customer who gets a different total on each phone is the visible symptom.
The Status, From Both Vendors
Sharing that logic used to mean betting on a cross-platform framework and giving up the native interface. That is no longer the trade. Android's own documentation says "Kotlin Multiplatform (KMP) is officially supported by Google for sharing business logic between Android and iOS" and "Kotlin Multiplatform is stable and production-ready" (Android).
The scope of that sentence is the point. What is shared is the logic. Each app keeps its own native interface, so nothing about how the product looks or feels on either platform has to change. Sharing the interface as well is possible and entirely optional.
Stable Does Not Mean Finished
A status headline hides detail a planner needs. One mechanism that most tutorials lead with is still marked Beta: "Expected and actual classes are in Beta. They are almost stable, but migration steps may be required in the future" (Kotlin). The documentation recommends a simpler approach for ordinary cases. Our own article led with the Beta mechanism until this month.
The build setup also changed this year. Projects created from an older template rely on tooling that the Android documentation now describes as deprecated, and that is the first thing to fix before building on it.
It Does Not Have to Be a Rewrite
The sensible path is staged, and the Android app stays shippable throughout. Shared data definitions first, which changes no behaviour. Then the pure business rules, which are the easiest code to test. Then storage. Networking last, because it touches the most. A team can stop after any stage and keep what it has.
What to Ask Your Team
- How many business rules do we implement twice today? Ask for a count.
- When did the two apps last disagree on a result?
- Which parts of the approach we would use are stable, and which are Beta?
- What is the smallest first stage that proves the build works?
-Rocky
#MobileStrategy #KotlinMultiplatform #EngineeringCost #EngineeringDreams #StrategiaX
Originally published on ANDROID-ARCHITECT, the Android engineering blog of Strategia-X, with the project setup and code.
