Developing an Ecommerce App in Kotlin Multiplatform: A Use Case

Photo of Patryk Szczygło

Patryk Szczygło

Updated Jul 21, 2023 • 11 min read
kmm

Netguru conducted a two-year research and development (R&D) initiative to assess the potential and viability of Kotlin Multiplatform for businesses.

A couple of years ago, we spotted it as a nascent cross-platform technology, but we also found it as a robust tool to extend our native capabilities. As we wrap up our R&D journey, we’ve seen how powerful Kotlin Multiplatform can be for a wide range of digital products, especially ecommerce apps.

Kotlin Multiplatform is a relatively new software development kit (SDK)that simplifies cross-platform app development by empowering developers to write the same business logic across multiple platforms, such as iOS, Android, and web apps.

However, rather than as an alternative to Flutter or React Native, Kotlin Multiplatform combines the advantages of both cross-platform and native solutions, making multi-platform app development more efficient than conventional approaches.

Kotlin Multiplatform is already being used by industry-leading apps and companies, such as Netflix, PlanGrid, CashApp, Memrise, and VMware. We chose to apply Kotlin Multiplatform Mobile towards the retail and ecommerce sector to be able to test and demonstrate its immediate commercial value.

We also wanted to see how it will function with natively built features by developing it with augmented reality (AR), which is growing in significance more and more for online retailers.

This brief case study presents our R&D journey in studying Kotlin Multiplatform and how we’re looking to apply it in developing retail applications. This is particularly relevant to companies looking to achieve further efficiencies when building or enhancing their ecommerce apps across different platforms.

Netguru’s R&D journey in Kotlin Multiplatform

Kotlin Multiplatform and its subset Kotlin Multiplatform Mobile (KMM) are relatively new technologies having been released as an Alpha in 2017 and transitioned to beta in 2022.

We decided to invest in it early as a way of upskilling our native app development capabilities. We already have about a hundred mobile app engineers who can code in Swift, TypeScript, Dart, and Kotlin, and so we recognized that we can leverage our existing expertise to learn Kotlin Multiplatform.

We spent the first year of our journey on research and the second year on development. We’ve recently moved into the implementation phase — ready to build cross-platform products for our customers.

Our first year of research about Kotlin Multiplatform and KMM focused on validating its commercial utility and figuring out the skills we need. We assembled a small team to investigate recurring patterns and concerns, as well as what works and what doesn't. This helped us formulate technical approaches, identify business use cases, and decide on additional investments in growing our capabilities.

kmm_internal_project_netguru

During the development phase, the second year of our R&D journey, we focused on training our engineers and further sharpening our understanding of Kotlin Multiplatform. We did this by exploring various use cases for Kotlin Multiplatform, including ecommerce, which I’ll get more into in a bit.

We built internal digital products to see how Kotlin Multiplatform works and performs across a range of aspects, such as architecture, code sharing, and navigation, among many others.

At the outset of our Kotlin Multiplatform R&D journey, we aimed to be able to build Android and iOS apps that share most (if not all) business logic in its codebase. Hence, we anchored our training program on different sample projects, which confirmed our hypothesis on how transformative it could be, especially for retail app development.

We’ll be featuring more of our R&D projects in the future, some of which we’ve begun to open source. This is part of our contribution to the Kotlin Multiplatform community of developers. For instance, we created a library of chart composables (and published it in open source) to help us build dashboards more efficiently for future Kotlin Multiplatform projects.

Building ecommerce apps with Kotlin Multiplatform & KMM

Early on, we set out to test Kotlin Multiplatform Mobile for ecommerce apps to be able to demonstrate its immediate commercial value — that while still in early beta, KMM is no longer experimental and can bring measurable efficiencies and innovations to the app development process.

Hence, in one of our R&D projects (to train our engineers, as well as to test and play around with Kotlin Multiplatform Mobile), we built a prototype for an ecommerce mobile app for a hypothetical furniture retailer. This app demonstrates the capabilities of KMM for retail with shared resources, logic, and data.

Here were our objectives for the retail track of our R&D initiative:

  1. To test KMM in building an ecommerce app
  2. To test how natively built features (focusing on augmented reality) will function and cooperate with KMM
  3. To be able to demonstrate KMM’s business case by showcasing high-value features, such as:
  • Full product customization
  • Augmented reality (AR) of the product in the highest quality possible
  • User generated content that allows shoppers to see photos from those who have already bought the product

The development team wrote all the business logic entirely in KMM. Our priority was to assess the shared business logic for Android and iOS within a single codebase, while writing the user interface natively, which our developers implemented using Jetpack Compose and SwiftUI. For the frontend, it was vital for us to see how Compose would work along with KMM.

In offering Netguru’s new capabilities in Kotlin Multiplatform to our existing and prospective clients, we’re focusing on being able to demonstrate what it can do for UI and UX. We thought about the most interesting user flows and how to build it rapidly.

For more technical details about our implementation of this ecommerce R&D project, check out Netguru GitHub entry.

Augmented reality with Kotlin Multiplatform

The reality remains that certain types of features are best done through a native approach, which include camera features, machine learning, heavy animations, and augmented reality (AR). With Kotlin Multiplatform, development teams can implement these features natively and write the business logic in Kotlin Multiplatform.

This is exactly what we did in this furniture ecommerce app. We experimented with AR to display furniture with different backgrounds or settings. Unlike other cross-platform solutions, KMM enabled us to execute this natively without limitations.

This now makes the Virtual Try-On (VTO) feature more accessible to startups and small businesses, not just giant retailers. VTO allows users to virtually sample or “try on” products — usually clothes, accessories, personal effects, and even furniture — using augmented reality (AR) to overlay real-world and virtual environments together.

Because online shopping is a visual experience, retail apps should consider leveraging camera features, such as VTO, computer vision, or image search. Camera features, however, complicate cross-platform development.

This is precisely one of the unique advantages of Kotlin Multiplatform, wherein businesses can natively create these types of advanced features and write the rest of the business logic more efficiently in a shared codebase.

Having an iOS app, an Android app, and a web app with augmented reality and other device-specific features can now be done more efficiently than ever before.

person holding smartphone with an ecommerce app open

What businesses should know about Kotlin Multiplatform

With all the tinkering and technical work we’ve done with Kotlin Multiplatform, we’ve come to the conclusion that it’s a digital technology that we’ll be endorsing to our own customers. If you’re a decision-maker in a business of any size, whether in the tech sector or otherwise, here are some of our key highlights for you.

  • If your app already exists on one platform (e.g. Android), and you want to expand to another (e.g iOS), Kotlin Multiplatform is ideal for your business. Instead of building a new native app by duplicating all of the code you've previously created for your existing app, Kotlin Multiplatform Mobile will simplify the development process. For instance, when building a new iOS, your development team will just need to write the native UI and share some of the business logic from your existing Android application.
  • If your app already exists in both Android and iOS, and you inevitably will have to enhance them, Kotlin Multiplatform Mobile has plenty to offer. For businesses and organizations with existing Android and iOS apps that don't share any code, your technology teams can most definitely implement Kotlin Multiplatform Mobile at any time and share as much or as little business logic as you like. When you start adding new features, you can consider sharing code between platforms without having to refactor or restructure everything you've done. On the other hand, you can also choose to refactor at your own pace if you wish to have a codebase that only needs to be maintained once and doesn't require separate updates for the Android and iOS components.
  • In effect, Kotlin Multiplatform enables companies to deliver digital products faster and with a lower cost. Based on our R&D, using Kotlin Multiplatform for a cross-platform app development project can save technology teams 30-50% of development time. Because Android and iOS apps use the same lines of code for business logic, it’s easier and faster to develop and test new features.

Kotlin Multiplatform is a powerful tool for companies to grow their digital business more efficiently. This will give you the opportunity to focus more broadly on product development and building the business side of your apps. To see how multinational businesses and their technology teams are using Kotlin to simplify their development processes, visit Kotlin Multiplatform case studies page.

KMM-retail_mockup

Kotlin Multiplatform is business ready

We’ll be continuing our efforts to experiment with Kotlin Multiplatform and what it can offer to a wide variety of use cases. We’ll also continue to contribute to the Kotlin Multiplatform developer community by publishing our repositories, wiki pages, and other technical resources. We’ll be communicating further how it can deliver value to different verticals and industries.

At this point, we’re pleased to say that we’ve wrapped up our R&D process, and it’s time to share and apply what we’ve learned. With its technical capabilities, we know that Kotlin Multiplatform is ripe and ready for business.

Reach out to us at Netguru to learn more about Kotlin Multiplatform mobile app development services.

Photo of Patryk Szczygło

More posts by this author

Patryk Szczygło

Patryk is an engineer leading R&D department to develop more knowledge in cutting edge...
Kotlin Multiplatform App Development  Reduce development cost and increase team efficiency Check how

We're Netguru!

At Netguru we specialize in designing, building, shipping and scaling beautiful, usable products with blazing-fast efficiency
Let's talk business!

Trusted by: