Level Up Coding

Coding tutorials and news. The developer homepage gitconnected.com && skilled.dev && levelup.dev

Follow publication

Incremental Migration from Android to KMP Project — Part 3

Firebase Integration in Kotlin Multiplatform

Analytics, Crashlytics, Realtime Database and Remote Config Integration

Siva Ganesh Kantamani
Level Up Coding
Published in
9 min readJan 28, 2025

--

This image was created using an AI image creation program.

Takeaway from this article

In this article, we will learn how to integrate analytics, crashlytics, real-time database, and remote-config in the Compose multiplatform project. To keep it simple, we will cover Android and IOS platforms in this article. We’ll cover the Desktop variant in the next parts of this series.

Introduction

This is part 3 in the series of migrations from the Android project to the compose multiplatform project. In Part 1, we discussed the KMP technology and the tech stack that is used in the application that is being migrated to KMP. Then as a first step, we started with dependency injection migration from Hilt to Koin.

In the second part, we covered the migration of the network layer from Retrofit to Ktor and the annotation processor from KAPT to KSP for code generation. Following are the links to the previous articles in case you missed it.

  1. Migration Guide From Hilt to Koin
  2. Migration Guide From Retrofit and KAPT to Ktor and KSP

With that being covered, let’s focus on covering today's concepts. For Android and IOS, the popular choice is Firebase. Firebase is capable enough to cover basic to advanced needs like analytics and crashlytics to track user behavior and application crash rates. It also can act as a server for your application via a Realtime Database or Firestore. With Firebase Remote-Config you can do A/B testing, staged rollout of a major release or feature, etc.

Firebase officially supports Android and IOS but does not support the Compose Multiplatform out of the box. For this, we need to use Firebase Kotlin SDK. The Firebase Kotlin SDK is a Kotlin-first SDK for Firebase. It is similar to the Firebase Android SDK Kotlin Extensions but also supports multiplatform projects.

In the documentation, it is mentioned the support for all four platforms: Android, IOS, Web, and Desktop, but as of now, it’s only working with Android and…

--

--

Responses (1)

Write a response