DEV Community

Cover image for How the Kotlin Multiplatform saves development time. Personal experience of creating a quest application for KotlinConf 2019
Alex Pogrebnyak
Alex Pogrebnyak

Posted on

How the Kotlin Multiplatform saves development time. Personal experience of creating a quest application for KotlinConf 2019

Hi there! IceRock Development here.

We would like to share our experience. We have been developing applications on the Kotlin Multiplatform for 2 years now. In 2018, we started implementing projects and made several important discoveries from the get-go. Among other things, we found out that the use of multi-platform technology saves a lot of time and effort.

We were once again convinced of its effectiveness at KotlinConf 2019, which took place in Copenhagen. This is the largest event in the world for Kotlin programmers. They come together to conduct workshops, exchange experience and just have a good time with like-minded people.

Alt Text
Yes, it is a bit crowded. Because the community of programmers comes from several dozen countries. Photo from the official JetBrains website

JetBrains, the organizers of the conference and the creators of the Kotlin language, offered us a project. A new version of the language was presented at the conference. It allows users to write code, including for Apple smart watches. To demonstrate this functionality, we had to create an application for three platforms: iOS, Android and WatchOS.

A quest in the name of Kotlin: what we managed to do for the conference

During the preparation for KotlinConf, we worked with JetBrains on the Kotlin Locator / Finder. This is a quest game where players had to run around Bella Center. Bella Center is the second largest conference center in Scandinavia that was rented out specifically for KotlinConf 2019 in Copenhagen! It brought together 1,700 developers from all over the world.

The bottom line is this: players download the application and with the help of tips start looking for “magic points” that are marked with iBeacon tags. At these points, players can find interesting details about Kotlin: the history of the language, new tools, etc. The points are not that easy to find, as they appear only if the player approaches them at a certain distance.

To complete the game, the players need to find 6 beacons in different places.
Alt Text
This is the Kotlin Locator / Finder interface on iOS for smartphones

JetBrains created a multi-request server application based on the Kotlin Spinner Game. They called us and told us about the idea. The art lead started conjuring up the design while the technical director and a specialist took over the innards of the application.

We negotiated the protocol with the server, drew a map and created the application architecture. We started developing on the iOS platform for smartphones. The first item in the terms of reference was a smart watch. But a version of Kotlin that allows coding for watches was released later. Therefore, the application for the watch was made after the application for smartphones.

Alt Text
This is what the Kotlin Locator / Finder interface of a smart watch app looks like

We tested everything. At the very end, an Android programmer was called in and only implemented the UI for Android. And voila – the application was ready.

We would like to share our developments:

In the process, we got some useful experience:

  1. It was the first time we used Kotlin / Native on WatchOS with compiler version 1.3.60. And everything worked out great!
  2. Debug interaction from common Kotlin code with iBeacon tags. We worked with the Reedyuk / blue-falcon library. The library was eventually forked and refined. Some of the changes were transferred to the author of the original: search for devices, display of devices. He accepted our feedback and expressed his gratitude.

Alt Text
Summary: we can say that everything we had planned was successfully implemented. At the same time, we tested the new version of the Kotlin Multiplatform and were convinced that it really is possible to write an application on it for a smart watch.

The application itself was downloaded several hundred times in Play Market and App Store. For a local event, this is a very good indicator. 20 people reached the end of the quest. The winners were awarded prizes by JetBrains.

Alt Text
Just look at these faces! Yes, the guys look a little embarrassed

Alt Text
Understandably! Because the coolest Kotlin developers in the world were looking at them!

We saved time and costs for the team: what the Multiplatform technology gave us

Drum roll – only an iOS developer was working on the app full-time. The rest – the designer, the Android programmer and tester worked part-time. And we made a completely native application!

Native apps are more complex and therefore more expensive. For standard double-platform application development, we would have hired one developer for iOS and another for Android. Then we would have had to pay full time to two developers. That is, we would have done double the work and spent one and a half times more resources.

With Kotlin, development speed is boosted significantly. We used the moko-network and generated all the code for working as a server for two platforms according to the openapi specification. Also, all the logic code: the logic of the game itself, the work with data, local storage, etc., was written only once in Kotlin. There was no need to duplicate anything.

Most of the bugs were found during development and debugging of the iOS application. Therefore, we created practically bug-free applications for watches and Android.

The Kotlin Multiplatform code is very similar to Swift. The Kotlin Locator / Finder app on iOS and Android have the same business logic: one piece of code is responsible for behavior on both platforms. This gives the same level of detail and stability, and, accordingly, convenience for the user.

Alt Text
IOS app

Alt Text
Android app

When working on the Kotlin Multiplatform, we saved resources, which means that in the end, we were able to make the application cheaper for customers and market it much faster.

What The Kotlin Multiplatform Can Offer Businesses

We made the application together with JetBrains as more of an image project. But development is also a business. We were in the role of our own clients, as we spent resources in the same manner and waited for results, as is usually done when ordering an application for commercial purposes. Therefore, we were convinced on personal experience of how effectively the Kotlin Multiplatform helps solve business problems.

Brief summary:

Fast market entry. All the stages of development, verification and testing are almost 1.5 times faster than when creating native apps separately on iOS and Android. Although it all depends on the complexity of the UI, it is still possible to speed up development by an average of 20-50%.

Cost saving. With Multiplatform technology, there is no need to duplicate code, which means that there is no need to do any extra work. Therefore, there is no need to pay for the work of additional specialists. If the project is simple, one programmer can create applications for two platforms.

If the project is more complex, one specialist needs to write the general code and the business logic and a developer on another platform does not have to do any double work. All that needs to be done is connect the application to the shared library and add the UI.

Completely native application. The application is adapted for a specific platform and convenient for both developers and users.

Compatibility with other programming languages. If there is an application that the Kotlin Multiplatform has to be integrated into, there is no need to completely rewrite it. The language is similar to Swift and compatible with Java.

We at IceRock Development now run most of our projects using this technology. We announced 2019 as the year of the Kotlin Multiplatform at the company.

We are trying to contribute to the development of the international Kotlin community. Let us show you a couple of useful things:

Top comments (1)

Collapse
 
dector profile image
Denys M.

Thanks for sharing! It would be interesting to see more use-cases in the future.