Sitemap
Android Developers

Articles on modern tools and resources to help you build experiences that people love, faster and easier, across every Android device.

Follow publication

Jetpack Compose — Before and after

7 min readDec 15, 2020

--

The app

Graph of Tivi’s module structure. Generated using Jake Wharton’s handy Gradle task

Process of migrating

Video showing the Tivi app, before and after the migration

It feels like a no-brainer to me that Compose is the future of UI development on Android.

Metrics

APK Size 🗜

Chart showing APK size of Tivi
Chart showing method count of Tivi

Some notes about the numbers:

APK Size Analysis

We see a 41% reduction in APK size, and 17% reduction in method count when using Compose

Lines of code 📜

cloc . --exclude-dir=build,.idea,schemas
Chart showing lines of source code in Tivi

Build speed ⏳

Test setup

# Use performance governor to allow tweaking of max freq
sudo cpupower frequency-set -g performance
# Set max frequency to CPU minimum: 1.2GHz
sudo cpupower frequency-set -u 1.2GHz
 ./gradlew --profile \
--offline \
--rerun-tasks \
--max-workers=4 \
assembleDebug

Results

Chart showing median build time of Tivi

Caveats

Feature work

Dependency updates

Compose is in beta

Summary

--

--

Published in Android Developers

Articles on modern tools and resources to help you build experiences that people love, faster and easier, across every Android device.

Responses (16)