# Jetpack Compose -- Before and after

DevFeed: [Jetpack Compose -- Before and after](<https://devfeed.tech/articles/jetpack-compose-before-and-after-24926.md>)

Original publisher: [Read original article](<https://medium.com/androiddevelopers/jetpack-compose-before-and-after-8b43ba0b7d4f?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2020-12-15T13:54:19Z

Content type: comparison

Language: en

Sources: [Chris Banes on Medium](<https://devfeed.tech/sources/chris-banes-on-medium.md>)

Topics: [Compose](<https://devfeed.tech/topics/compose.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Android](<https://devfeed.tech/topics/android.md>), [migration](<https://devfeed.tech/topics/migration.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [modules](<https://devfeed.tech/topics/modules.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [build](<https://devfeed.tech/tags/build.md>), [compose](<https://devfeed.tech/tags/compose.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [migration](<https://devfeed.tech/tags/migration.md>), [modules](<https://devfeed.tech/tags/modules.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

This article reviews the migration of the Tivi Android app's UI to Jetpack Compose. It compares APK size, build speed, and source line count, and describes how the app's modular structure enabled an incremental migration.

## Source excerpt

Jetpack Compose -- Before and afterHow the build speed, APK size and source line count changed after migrating the Tivi sample app to Jetpack Compose This post has been updated since it was first published, to new include updated stats for Jetpack Compose 1.0.0-rc01. If you would like to see the original version of this post, see here. In 2020, I began the task of slowly migrating the UI in Tivi to be written in Jetpack Compose, and roughly 12 months later it is now complete. 🎉 In this blog post, we'll take a look back and compare a number of key metrics to see how well Compose compares in: APK size, build speed and lines of code. The app Before I go any further into the Compose side of things, let me quickly describe the app. Tivi is pretty heavily modularized, with each UI 'screen' in its own Gradle module (named ui-$NAME). Each of those screens was implemented in a Fragment, and then pieced together using AndroidX Navigation in the main app module. To give you an idea of the structure, here's a graph of the modules in the app: Graph of Tivi's module structure. Generated using Jake Wharton's handy Gradle task Most of the fragments had no knowledge of each other, since the navigation graph was implemented using deep link URIs, ensuring decoupling. Perhaps more importantly, it also allows independent module compilation which aids build parallelism. Note: the module structure of Tivi is not perfect by any means. There are too many dependencies of UI modules (at the top) to base modules (at the bottom). Ideally each layer should be seperated. Something for me to work on. Before I started the migration to Compose, Tivi used all the cool 🌈 UI 💫 things available to Android developers: Data Binding, Epoxy, Material Design Components, Insetter DBX, MotionLayout to name a few. But unfortunately most of these came with a build cost since they use annotation processing. Process of migrating Earlier I mentioned that we had just completed the 'first stage' of the migration, so w