strings.skip_to_content
About Projects Articles
/assets/bachelor-thesis-header.png

Kotlin Multiplatform in Future Lab App: Insights into my Bachelor Thesis

University Kotlin Multiplatform App Development

Starting in August 2024, I worked on my Bachelor Thesis at the Media Computing Group of Professor Jan Borchers (Chair i10 at RWTH Aachen, Germany). I had the chance to work on migrating an interactive Science Guide from native iOS and Android implementations to a cross-platform framework. I am very grateful for the opportunity to write my thesis at this chair. I want to thank Jan Borchers and my supervisors, Kevin Fiedler and Oliver Nowak, who provided valuable feedback while working on the thesis!

Below are the abstract and introduction of my bachelor's thesis.
The full version is available here.

Abstract

This thesis presents the adoption of Kotlin Multiplatform (KMP) to facilitate a cross-platform architecture for the Future Lab Aachen App (FLApp), an interactive mobile guide to Aachen’s scientific and historical landmarks. Due to being built as two native implementations for iOS and Android, FLApp suffered from code duplication, platform inconsistencies, and maintainability issues. These problems motivated the migration to a unified, cross-platform architecture while maintaining feature parity and enhancing developer productivity.

In our work, we evaluated various cross-platform framework options and selected KMP for FLApp because of the native-oriented features and incremental adoption capabilities. We executed a migration plan that involved transitioning from Objective-C to Swift and incrementally adopting KMP to unify the business layer.

Later, we evaluated the achievement of our goals and our developer experience using KMP for FLApp. We mitigated the previous issues of FLApp and created a stable foundation for future work. We were able to significantly improve maintainability, code reuse, and architectural consistency while preserving native user interfaces. The results demonstrate that KMP is a suitable framework for native-to-cross-platform transitions. The insights gained from this project provide valuable guidance for similar migration efforts, covering everything from framework selection to execution.

Introduction

The Future Lab Aachen App (FLApp) is an interactive mo- bile guide to Aachen’s scientific and historical sites. It uses GPS navigation and augmented reality to present multimedia content like audio, videos, and 3D models. Initially developed in 2017, the app runs natively on iOS and Android. It was initially built with Objective-C for iOS and Java, later switching to Kotlin for Android.

While native apps provide vendor-optimized performance and deep integration into the platform, building and maintaining two native apps can be time-consuming and require knowledge of both technologies. Code duplication may introduce inconsistencies between the platforms, and new features and bug fixes must be addressed individually [Amatya and Kurti, 2014; Corral et al., 2012].

Having separate native implementations for iOS and Android brought several challenges to FLApp’s development. One major issue arose in how each platform handled content parsing from the local plist files. This issue caused inconsistencies in the display of content on both platforms. Moreover, the architectural approaches diverged between platforms: iOS utilized the Model-View-Controller (MVC) pattern, while Android implemented the Model-View-View Model (MVVM).

Cross-platform mobile frameworks offer solutions for improving maintainability, removing code duplication, and avoiding inconsistencies in the app experience [Corral et al., 2012; Amatya and Kurti, 2014]. Developers can build applications using web-based technology like Progressive Web Apps (PWAs) or Ionic. Frameworks such as React Native or Flutter offer another approach to cross-platform development. Kotlin Multiplatform (KMP) offers a more native-oriented solution and enables the sharing of business logic while keeping native UI implementations and the flexibility to integrate platform-specific frameworks as needed.

We aimed to migrate FLApp to cross-platform technology while ensuring a good user experience (UX), establishing a unified codebase with consistent architecture, and enhancing overall maintainability.

Based on our cross-platform technologies and literature review evaluation, KMP emerged as a suitable solution for FLApp. KMP enables us to maintain the native user interface and complex features like Augmented Reality and iBeacon Tracking on iOS and Android while easily sharing the underlying data model layers between both app versions. This technology selection ensures a consistent app architecture across both platforms.

KMP provides a good developer experience, although Kotlin-Swift interoperability currently relies on Objective-C, complicating integration with Swift-only frameworks. JetBrains’ upcoming direct Kotlin-to-Swift export feature promises to improve up on this issue.

Selecting KMP for FLApp’s cross-platform transition proved to be a good decision. We maintained our native user interface and avoided a full technology migration. Implementing a shared data layer allowed us to reduce code duplication, resolve existing bugs, and ensure consistent content parsing across platforms without introducing regressions or performance issues. Our new app architecture will empower new developers to streamline future updates and simplify maintenance by consolidating core logic across iOS and Android.


This was an excerpt of my Bachelor Thesis. If you are interested in reading the whole thesis, you can find the full PDF here.

(Excellent) syntax highlighting provided by Torchlight