Industry: Software Development
JetBrains products used: Kotlin Multiplatform Mobile
Magic Technology provides first class apps to clients from a diverse range of industries. It saves time, effort, and resources by using a shared codebase approach based on Kotlin Multiplatform Mobile.
Could you say a few words about your company?
It is a one-man company from the south of Sweden that develops mobile applications and backend solutions for large publicly traded companies, small local businesses, and municipalities. Most of the work is done by its owner, Bill Mårtensson, though he sometimes hires several other people to work on specific projects.
Bill also occasionally teaches mobile development at Malmö Yrkeshögskola. This school was the first Swedish vocational college to teach Kotlin for Android development, and it was also the first to provide up-skill training to Kotlin from older languages like Java. Since he started teaching in 2011, Bill has taught about 500 students.
How is Kotlin Multiplatform Mobile used in your product?
Over the last year I have used KMM in several projects maximizing its benefits by sharing as much business logic and code as possible. I use Ktor for requests in apps where APIs are called. I use kotlinx.serialization to serialize/deserialize. And I have used SQLDelight for local storage in applications where data is only saved on device, as well as in one where I enabled offline data caching.
One of the projects that I rebuilt with KMM now has the same backend and a custom frontend. The structure used to be an iOS framework with a few iOS apps and an Android package with a few Android apps, without any shared code. I set out to rewrite the iOS framework and Android package into one KMM codebase, and I also implemented SQLDelight for local offline caching. Thanks to the multiplatform capabilities of Kotlin, I could reuse parts of the code, which allowed me to finish the whole rewrite within just a week.
Why did you decide to use Kotlin Multiplatform Mobile, and what alternatives did you consider?
The main reason I chose KMM was to solve the long-standing problem of having to write code twice – once for Android and once for iOS. Because of Kotlin Multiplatform Mobile, I was able to cut down on both the time and costs spent on development.
Performance was also a big part of the decision. I have development experience with different multiplatform tools, and unlike its competitors, KMM provides the level of performance needed for reliable modern mobile applications, and it uses Kotlin, which is the base for most Android apps.
What have been your most significant gains and pains?
Being able to have a single codebase for complex logic is a very big gain. It helps prevent many errors and inconsistencies in projects that have quite advanced logic flows.
Using KMM with Ktor, Serialization, and SQLDelight, I was able to use a single codebase for all API calls, deserialization, and saving to a local cache. Then I only needed to use specific code for the UI.
KMM has changed a lot over time, and this has been its main drawback for me. I would also mention compatibility problems and lacking documentation.
However, these things are expected when using cutting-edge tools. All the changes have been to improve KMM, and I have seen big boosts in stability, documentation, and tooling over the last year.
Do you have any tips or advice you'd like to share with our readers?
I definitely recommend trying it out. Even if using an avant-garde tool has resulted in a few challenges along the way, it has simply worked for me from the start. I consider KMM my go-to tool for creating new projects when I am targeting both iOS and Android.
Bill Mårtensson, Owner