Kotlin logo

Kotlin

A concise multiplatform language developed by JetBrains

Multiplatform

Results of the Kotlin Multiplatform Survey Q1-Q2 2021

The Kotlin team has always relied on feedback from the community to make decisions about the future of the technology. You will always be the people who best know how to make Kotlin even more enjoyable to work with! That’s why a year ago we started a Kotlin Multiplatform Survey program to collect your feedback on sharing code with Kotlin Multiplatform, learn more about your use cases, and understand how we can improve the technology. 

The last survey was conducted in July 2021. It covers all code-sharing use cases that the flexible Kotlin Multiplatform technology allows you to implement. We collected answers from the backend, mobile, frontend, and full-stack developers who share code between various combinations of targets. 

Join the Kotlin 2021 Premier Online Event to learn more about Kotlin Multiplatform

It’s not a surprise that most of the responders were mobile developers, as using KMM for sharing code between iOS and Android remains one of the most popular use cases (58.8%).

The valuable and comprehensive feedback of active KMM users gave us a great understanding of each stage of the technology adoption process, from evaluating the technology and deciding which parts of their application they want to share to what tooling to use. As KMM’s move to Beta approaches, more and more developers want to use KMM as a foundation for their mobile projects. Today we want to share the overview of KMM users’ adoption path. We hope that these insights will be valuable for you, especially if you are interested in cross-platform mobile development. The experience of active KMM users can help you understand which adoption strategy to use and how to maximize the benefits from sharing code between mobile platforms with KMM in your specific project.

Who uses KMM and why?

Since November, the number of mobile developers with less than 5 years of experience has increased by 10%. We are excited to see this dynamic because it indicates that it’s becoming much easier to get started with KMM. All of this wouldn’t be possible without our lovely KMM community, which is actively contributing to the KMM ecosystem by writing articles, making videos, and creating illustrative sample projects. 

It’s great to see that KMM is used in very different types and sizes of companies, from one-person companies and startups to huge IT Corporations and big product companies. The flexibility of the technology allows you to choose the code-sharing strategy taking into account all your product and team specifics. You can maximize the amount of shared code and keep native only views, share only sensitive parts, use it for an existing project and port the code that was already written for Android to iOS or start a completely new project from scratch.

Almost half of the adoption cases are situations when both Android and iOS parts were already released. Even teams working on projects with a relatively large codebase migrate to KMM to take advantage of the code sharing. It helps them optimize time to delivery, get more concise results, and reduce the cost of development. It also demonstrates that KMM fits the needs of mature mobile projects.

Of course, speeding up the development process and reducing cost are important reasons for using any cross-platform technology, but the most popular reason among KMM adopters is having consistent logic across iOS and Android apps. It’s becoming even more meaningful in existing projects. Migration takes time, but the effort is worth it because you can be confident that all the sensitive logic works in the same way on iOS and Android. For example, some teams in Careem are using KMM to share event tracking to make sure events on iOS and Android are reported in the exact same way with the same parameters and event names.

KMM migration approaches that proved their efficiency 

While evaluating the technology, the vast majority of users (73%) created some kind of proof of concept app. It’s a great approach, as it allows you to make decisions on a bunch of organizational questions before diving into active development with KMM: 

  • How to organize the codebase – use monorepo for all mobile projects or have separate repositories?
  • Which approach of integrating common KMM modules with the iOS part of the project – CocoaPods, Xcode build phases, or something else?
  • Who will maintain the common code – Android developers, iOS developers, or a dedicated team?

There are no correct answers to these questions. 64% of KMM users have a single repository for all the mobile code and others store code in multiple repositories. The popularity of different approaches of KMM-to-iOS integration is roughly the same. KMM’s flexibility allows you to integrate the technology while taking into account all your product and team specifics. 

Playing with the POC app is a good way to prepare for the important decisions, and using sample projects as a foundation can save you time and effort. Check the curated KMM samples table to find a sample similar to what you want for your KMM project and dive into KMM right away! For example, you can find a sample that uses SQLDelight for data storage, modern declarative frameworks for the user interface, and that has the logic shared not only between mobile apps but also between a web client. 

As KMM integration with the Android ecosystem is seamless out of the box, Android developers usually are the ones who start the initiative to use KMM. However, it’s impressive to see that in almost a third of teams (30.6%) Android and iOS developers contribute equally to common code. We hope that this number will continue to grow!

We will put effort into improving KMM integration with the iOS ecosystem by releasing the new memory manager for Kotlin/Native, improving exporting Kotlin code to Objective-C, improving the UX of using Native libraries in Kotlin, and more to make KMM friendlier for iOS developers. Collaborative work on common code will allow teams to reduce the bus factor and easily create a common API that is convenient for using both Kotlin and Objective-C or Swift and helps all mobile engineers start speaking the same language 😉. 

What do developers share with KMM?

Almost half of KMM users (48.4%) share more than half of their codebase. 

It’s expected that functionality such as networking, data storage, data serialization, and internal utilities like analytics, logging, etc., are the most popular logic pieces to share. But developers want to share more! We can see an impressive number of developers, who want to have state management, navigation management, and presenters/controllers/ViewModels logic in the common module as well. Kotlin Multiplatform doesn’t force you into one exact sharing strategy. You can share a couple of complex algorithms that work consistently across all the platforms, or you can maximize the amount of shared code. There are already some useful libraries that will help you. 

As the number of developers using KMM increases, the demand for libraries of all kinds will rise proportionally. This provides a great opportunity for anyone who would like to contribute. If you want to join the community of library authors, follow our special series of articles that explains all the aspects you will need to know when creating your KMM library.

Going production

We are proud to see that despite the fact that KMM is only approaching the Beta stability level, the majority of KMM users are production users who have been evaluating the technology for their production projects or already have the applications with the shared code released.

In 85.3% of the cases, the full KMM adoption took less than 6 months. 

The goal of KMM is to improve the development process by reducing the amount of code you need to write and support. But sometimes the desire to optimize development negatively impacts the user experience of our apps. We are happy to conclude that this is definitely not the case with KMM. 98.3% of users are satisfied with the quality of their app after KMM adoption in terms of app performance, binary size, and appearance. We will continue to put effort into ensuring Kotlin Multiplatform allows you to avoid duplicating code without affecting the user experience.

Conclusion

We are excited to see that Kotlin Multiplatform Mobile is used in so many companies of different types and sizes, with so many code-sharing strategies being implemented. Regardless of whether you have an existing project or are starting a new one from scratch, want to speed up the development process by minimizing the amount of native code, or want to be confident what some of your algorithms works concise on both platforms – KMM can become a solid foundation for your mobile projects and improve the way you develop them. 

If you want to know more about cross-platform mobile development with Kotlin and our plans on moving KMM to Beta, join the Kotlin 2021 Premier Online Event on October 19 to hear updates from the team and news about the whole Kotlin ecosystem, including Kotlin Multiplatform and KMM.

Register for the KMM Beta Roadmap talk

Once again we would like to thank everyone who participated in this survey! Besides the user portrait and detail of the technology adoption, we collected a lot of insights about your needs and current pains. We will rely on these insights while adjusting our priorities to make Kotlin Multiplatform the best technology to work with. Your feedback is vital for the technology evolution and we will continue to conduct Kotlin Multiplatform User Survey on a regular basis.

Read more

The KMM team is looking for someone passionate about Kotlin Multiplatform Mobile to join us as a Developer Advocate, as well as someone who loves working with technical texts and documentation to become our new Technical Writer.

image description