Adopting Jetpack Compose - Part 1

The great first step of the Android group
DelightRoom's avatar
Jan 27, 2023
Adopting Jetpack Compose - Part 1

The great first step of the Android group

freepik.com

The Great Jetpack Compose Era

Android is currently in the middle of the great Jetpack Compose era (hereafter referred to as Compose). Our Android group is also writing composable functions today to apply the numerous benefits of Compose to Alarmy.

Our Android group has also successfully completed the adoption of Compose, and all new features in Alarmy are now being implemented with Compose. Through this post, I want to share the efforts we made and the challenges we faced while bringing Compose into Alarmy.

Breaking down a huge goal into smaller ones

The Android group's goal is to transition the entirety of Alarmy to Compose. Converting Alarmy to Compose is an amazing undertaking, but it is such a massive task that all the engineers naturally felt a sense of pressure.

So, what was the most important thing when first introducing Compose? It was exactly this: eliminating the pressure around Compose. Applying Compose code to a live service while still being unfamiliar with it is quite a heavy burden for both the writer and the reviewer. I thought that if we could relieve this pressure, all members would be able to adopt Compose smoothly.

To lower the pressure regarding Compose, we broke down our work goal into a much smaller one: "Just try using Compose." We decided to focus solely on the act of using Compose itself, setting aside perfection or advanced technical skills. Because the engineers could focus entirely on just using Compose, we figured they would be able to execute it quickly. Only after setting this goal of focusing purely on usage with the members were we finally able to break ground on adopting Compose.

Specific actions to achieve our goal

Our goal was to just try using Compose. Then, how could we effectively try using it? The specific action we chose was focusing on UI expression.

Compose provides many mechanisms that allow you to leverage various features of Kotlin. However, before using those advanced features, we first had to get used to utilizing Compose itself. (The basics are always the most important.) Therefore, we decided to focus on the core essence of Compose: UI expression.

We planned to focus on UI migration by first selecting screens that had no network calls or data processing and consisted of simple UI layouts. Thanks to this, the engineers could concentrate entirely on UI work, and code reviews could also be conducted with a focus on UI expression methods. Through the efforts of all group members, Alarmy's very first Compose screen was finally born.

Alarmy's About screen, reborn with Jetpack Compose

While migrating this simple screen to Compose, we were able to discover a huge variety of points for improvement. Seeing how just migrating the UI consistently generated topics for the group to discuss, I thought to myself that starting small was a really good idea.

Improvement points

  • Component structure (function names, scope, generalization)

  • Margin expression methods (padding, spacer)

  • Things to consider when utilizing composeView in a fragment

  • Whether to apply the Design System

  • …

We took time to discuss the improvement points that came up during code reviews in separate meetings. Through this time, we were able to brainstorm and decide on the best Compose application methods for Alarmy together. By repeating this process of applying Compose and discussing it, we naturally became accustomed to Compose.

After the initial adoption of Compose

After the initial adoption of Compose, we started the transition in earnest. Moving beyond simple screens, we even migrated data-heavy screens to Compose, and all members went through a lot of trial and error. Now, everyone has grown, and we are implementing all new features using Compose.

But it doesn't end here. As various features are added, many discussions still arise, and we are moving forward by solving them together. I will gradually introduce the stories of what we experienced while developing new features together in the following posts.

Conclusion

If you have decided to adopt Compose, I recommend setting an immediately actionable goal and executing it. I hope this post will be of some small help to any group still debating whether to introduce Compose.

Share article