Jetpack Compose 1.0: Where to start?

Souleymane Sidibe
5 min readAug 10, 2021

We all heard it. The new declarative UI Toolkit for android is now out. It’s stable and ready for production. We have a lot of materials out there and it can be confusing. So I decided to help you a lil bit and proposed you a path to success on your Compose journey :)

Understand Compose key principles and mental model

Jetpack Compose is a whole new way of doing android UI. You need to understand some key principles. And this link is the best place to start.

https://developer.android.com/jetpack/compose/mental-model

Just after this you can check two videos from Romain Guy and Leland Richardson.

And the last part is this podcast from the Android Developers backstage:

I think with these resources you will have lot of insights about Compose and hopefully a better understanding.

Baby steps

Just reading, listing or watching contents isn’t enough you need to practice, feel the difference. And for this, I propose you first a live coding session with Florina.

You can watch first and then do it yourself. Or you can follow her along.
The updated codelab is available down below:

https://developer.android.com/codelabs/jetpack-compose-basics

Oh you need more? Okay don’t worry I have what you need. ;)

Laying out Composable is important to build modern and complex interfaces.

https://developer.android.com/codelabs/jetpack-compose-layouts

And also theming helps you emphasize your brand.

https://developer.android.com/codelabs/jetpack-compose-theming

More advanced topics

Okay you know how to build basic things. What’s next?
Well, building UI is all about states and how to manage them well.
I first want to talk to you about a topic not directly related to Compose but it will be a key part of your success on Compose. Either on a brand new project or integrating it on an existing codebase (using the view system).
Uni directional data Flow (UDF).

A unidirectional data flow is a design pattern where state flows down and events flow up.

We will not deep dive on this but as usual I have links for you ;)
First a short explanation of what is UDF:

Then Google’s Compose team thoughts about UDF:
https://developer.android.com/jetpack/compose/architecture

You can find a lot of content online about this topic.
But what about state in Compose? You probably heard about stateless composable and statefull composable

https://developer.android.com/jetpack/compose/state

You can also practice with this codelab:

https://developer.android.com/codelabs/jetpack-compose-advanced-state-side-effects

You have a lot of advanced topics like graphics, animations, custom views, testing, etc. But I’ll not cover them all. Or maybe I’ll update this post later.

Open source projects

The google team and also the community created a lot of open source apps to showcase what you can achieve with Jetpack Compose. You should install them install them on your device and then see what you can build and then deep dive in the code to see how it’s implemented.
You will learn a lot about Compose. So here are the links:

This first project is from google and you have a lot there.

Below a a sneak peek of what you’ll find :)

I also build a small sample. I talked about it here

Last but not least this project from Vivek Singh. You will learn a lot about compose animations, integration with Kotlin Coroutines and Flow and much more.

Compose Under the hood

You are comfortable building apps using Jetpack Compose and you want to learn what is going on under the hood.
The source of truth is the Compose code base. It’s open source so you have access to it.

The source can be tough to understand so you can first start with something lighter.
This one was at KotlinConf19. You’ll understand how the Compose Runtime works.

The next link is a book. Compose is new but regarding how they built it (open source, multiple milestones from dev version to the stable, communications, and so on), a book about compose is not too early or surprising. I do not read it yet. I can not give you a review about it but it was written by well known android developers.

Convince your teammates

Compose is relatively new. The first stable version was released weeks ago. So it may be difficult to convince your teammates to start using Compose in your company’s existing apps. To be honest I might be surprise if it’s the case.

What you can do is, first learn Compose yourself and understand it. At least the basics. And then build some samples of what it’ll look like to add Compose and the benefits. And last but not least share with them these testimonials from company like Monzo, Twitter. I think it can help :).

https://developer.android.com/jetpack/compose/why-adopt

It’s your turn to inspire us :)

Bonus link

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Souleymane Sidibe
Souleymane Sidibe

Written by Souleymane Sidibe

#developer #tech #kotlin #android lover

No responses yet

Write a response