As soon as Kotlin-Multiplatform technology appeared, we saw in it the opportunity to optimize and accelerate the development of mobile applications.
What were the results? Nikolai Baklanov, our senior iOS Developer will tell you in his presentation “Experience in the use of Kotlin-Multiplatform technology, attempts to reduce everything to one language.”
8. Lack of experience and level of skills
Studying the language, its
constructions and capacities
Compilation of all modules, linking
them together, adding
dependencies
9. There are no common libraries
Alamofire / RxSwift Retrofit / RxJava
ktor
kotlinx.serialization
coroutines
10. Version matters
All libraries used for ios must be compiled
by one version of kotlin/native
Kotlin/Native had unstable ABI because it was in beta
11. Nothing general - only specific
Try to use less generics in public interface
Generics were erased and to ios got only classes without types.
From version kotlin 1.3.40 generics basic support was added.
12. Multithreading
Think carefully about multithreading considering hard
limitations on working with objects from different threads in
Kotlin/Native
Kotlin/Native has mechanism of freezing objects and detach/attach
objects for transfer between threadings, which does not exist in jvm
13. Measure thrice and assemble once
Use compilation to android platform and compile in ios for
active development of general code when there are no
mistakes of compilation in general code
Kotlin/Native has no incremental compilation and compilation takes a lot of time
14. Jupiter can do what iOS can’t
Check current limits for Kotlin/Native working with
Serialization
Not all things are available in native (some time ago enum class and
inheritance were not available for native targets)
15. Debugging
Use breakpoint references in console by name to debug in
iOS or use plugin for xcode from touchlab
xcode does not allow to put breakpoint in kotlin file from box, but we can use
debugger lldb because compilation is done by llvm
17. Android Project
Project for Android where we use KMP and OpenCV. Application serves to
identify amphibians and store information about them into base. It help
zoologists.
19. Overcoming Pain via EMDR
Application for listening to meditations that help people to cope with mental
disorders. Application is actively used, constantly changing and developing.
Application has a fee for service.
App Store
Play Market
20. To sum up
It helps to save time of development. Using this technology for the project we
spent:
● For developing interaction from API server - 38 hours
● For realization of business logics and model classes - 24 hours
It was done in common module. If we developed in classical scheme we should
have done the same procedure for both platforms. Precisely these features helped
to save 62 hours.
23. Common code. Business logics,
model objects, backend interaction.
Android Native UI SwiftUI
24. Common code. Business logics,
model objects, backend interaction.
Android Native UI SwiftUI
Server