Skip to content

Google Bets on Kotlin Multiplatform: Koin Leads for Android & KMP

Koin & Kotlin Multiplatform (KMP)
Image from Google I/O 2024

Google I/O 2024 brought some heat for mobile devs this year.

One of the standout announcements was Android's plan to embrace Kotlin Multiplatform. And also the latest updates to the ever-popular Jetpack Compose UI toolkit.

These developments will undoubtedly have a major impact on the future of Android app development.

At Google I/O 2024, Google made it clear that Android is officially supporting Kotlin Multiplatform.

What this means is that they now officially recommend using KMP to share business logic across Android, iOS, and Web, promising robust tooling and library support.

Screenshot 2024-05-16 at 15.32.13

Ok, let's talk about these in a little more detail:

Android's Kotlin Multiplatform Support

Google unveiled its vision to support Kotlin Multiplatform (KMP) on Android, enabling you to share business logic across mobile, web, server, and desktop platforms. This strategic move aligns with Android's Kotlin-first approach and promises to boost developer productivity while enhancing the quality of Android apps.

Google outlined a roadmap that includes expanding and stabilizing KMP support in Jetpack libraries, improving Kotlin/Native build performance, enhancing debugging capabilities, and enriching Android Studio with more KMP-centric features. The benefits of code reusability and increased development efficiency through KMP are clear, and Google's commitment to this paradigm is a significant step forward.

Jetpack Compose June '24 Release

Alongside the KMP announcements, Google showcased the upcoming June '24 release of Jetpack Compose, packed with features designed to streamline Android development across various form factors. Notable additions include shared element transitions, list reordering animations, improved text handling, and performance enhancements.

Furthermore, Google announced expanded Compose support for Android TV (reaching 1.0 Beta) and Wear OS, underscoring the company's dedication to providing a consistent and modern UI toolkit across the entire Android ecosystem.

Ok, now let's go back a bit:

The Importance of Kotlin Multiplatform

The ability to share code across platforms is a game-changer for mobile app developers. By using KMP, teams can reduce development efforts, maintain consistency across platforms, and accelerate time-to-market for their applications. Additionally, KMP promotes code reusability, helping to decrease technical debt and improving overall maintainability.

Implications for Multiplatform App Development

Google's announcements solidify their commitment to Kotlin Multiplatform and the broader adoption of modern, cross-platform development practices. As KMP support matures within the Android ecosystem, we can expect to see more and more developers embracing cross-platform development, leading to a flourishing of multiplatform apps and a vibrant ecosystem of supporting libraries and tools.

From a business perspective, the potential for increased development efficiency, reduced costs, and faster time-to-market makes KMP a really attractive proposition for companies wanting to deliver high-quality apps across multiple platforms.

Koin for Kotlin Multiplatform Projects

Ok, let's talk about dependency injection.

Screenshot 2024-05-16 at 15.28.01

You may have already seen the amount of buzz on the socials regarding the implications for Dagger/Hilt and how they fit into this evolving landscape, as seen in discussions like this one.

So what we know for a fact right now is that we can't use Dagger/Hilt for dependency injection when building a KMP app. Right now, as we speak, we're also not aware of a roadmap in place to address this.

Koin for Kotlin Multiplatform Projects

But as you can see from this JetBrain's post here ☝️, there are credible options for DI to support your KMP journey. Koin has been KMP-compatible since its inception, making it a natural fit for managing dependencies across platforms.

With its modular design and platform-agnostic approach, Koin simplifies the process of sharing code while ensuring clean and maintainable architectures. By providing a consistent DI solution across platforms, Koin helps devs reduce complexity and maintain code consistency, ultimately leading to more robust and scalable applications.



Koin with Jetpack Compose

As Jetpack Compose gains traction and becomes the de facto UI toolkit (arguably?) for Android development, Koin's compatibility with KMP positions it as an ideal partner for building Compose-based applications across multiple platforms.

Compose MP & KMP & Koin

You can use Koin to handle dependency injection in your Compose apps, adhering to best practices and following platform-specific configurations. Koin's modular approach allows for efficient management of platform-specific dependencies, ensuring a seamless development experience across Android, iOS, Web, and desktop platforms.

Koin's Role in the Evolving KMP Landscape

As the adoption of Kotlin Multiplatform and Jetpack Compose continues to grow, the need for robust and scalable libraries like Koin becomes super apparent. By providing a consistent and well-designed DI framework, Koin can help you maintain a high level of code quality and architecture consistency across platforms.

As the KMP ecosystem evolves, Koin's role in simplifying dependency management and reducing complexity will become even more crucial, enabling developers to focus on delivering innovative and high-quality applications without being bogged down by platform-specific intricacies.

Wrapping Up

Google's announcements at I/O 2024 have set the stage for a new era of cross-platform development on Android. As the industry embraces Kotlin Multiplatform and Jetpack Compose gains momentum across various form factors, libraries, like ours become even more valuable.

With its KMP compatibility, modular design, and proven track record, Koin shines is a pretty powerful ally for developers seeking to leverage the full potential of Google's vision for multiplatform app development. By simplifying dependency management and promoting code consistency, Koin empowers teams to focus on delivering innovative and high-quality applications while navigating the evolving KMP landscape with ease.

As you embark on your next Android project, whether it's a multiplatform one or a Compose-based application, consider exploring Koin as your trusted companion for dependency injection. Leverage the resources available, including documentation, sample projects, and the vibrant Koin community, to kickstart your journey towards more efficient and scalable app development.

And don't forget to download your cheat sheet to help you get started: