A Joyride with Jetpack Compose

Priyansh Agarwal
Developer Students Club, VJTI
4 min readJan 5, 2023

In the initial months of 2022, I started studying Android App Dev. Initially, I was just experimenting with the domain, developing small apps to toughen up my core concepts. In the beginning, I was working in Java but soon I switched to Kotlin because I couldn’t stand the long and boring syntax of Java and XML. I realized that I’ll need something better than this to work on apps having a complicated codebase and workflow. During this switch, I started looking out for new libraries that supported Kotlin. This is when I found Jetpack Compose.

Jetpack Compose is a declarative, modern toolkit for building native Android UI. It was developed by Google and is a part of the Android Jetpack suite of libraries. With Jetpack Compose, developers can build a beautiful and functional UI with less code, making it easier and faster to build high-quality Android apps.

Jetpack had its first stable release in July ’21. Hence, even though it’s a fairly new technology, it quickly became a favorite among developers. Companies were quick to realize the power this library possesses. Many big leading companies have now completely migrated their UI from XML to Jetpack Compose.

Some of these big names include Swiggy, Soundcloud, AirBNB, and Twitter.

You can visit the official page for more information

How is it helpful?

One of the main benefits of Jetpack Compose is that it is fully integrated with the Android operating system and the Kotlin programming language. This means that it can take advantage of all the latest platform features and optimizations, resulting in faster and more efficient app performance.

Jetpack Compose has a concise and intuitive syntax, making it easy for developers to generate complex UI with lesser code. It follows a declarative style of programming, which means that developers describe the desired UI by calling respective functions and defining their attributes. This helps in micro-managing the UI very easily.

One of the unique features of Jetpack Compose is its ability to support “composition over inheritance”.In layman’s terms, whenever the state of the UI changes, the UI is regenerated or ‘recomposed’. This brings a dynamic and interactive look to the UI. This makes it easier to reuse code and create a more complex UI with less effort.

A sample UI written in Jetpack Compose

An example of an app written using Jetpack Compose. The complete code can be found here.

For more such apps you can checkout this repository made by the developers from android. It contains sample apps written using Jetpack Compose.

How to start ?

One can start by following the google codelabs tutorials on jetpack compose. For people who don’t know, Google Developers Codelabs provide a guided, step-by-step tutorial on many topics. For me, these worked better than any youtube explanations.

Once, you’re comfortable with the architecture of a Jetpack app, you can move ahead to start working with various jetpack based tools like navigation component, animation. After completing these small milestones, you can move ahead to studying and watching code-alongs from various youtubers like Phllip Lackner, Coding with Mitch, and many others.

You should also refer to websites like Jetpack Compose Playground, Jetpack Compose documentation. These websites will provide you a visual explanation of every component and feature offered by jetpack.

It is always better to have a hands-on approach to learning something.

Ending!!

In conclusion, my experience with Jetpack Compose has been nothing but a joyride. It has greatly simplified my workflow and has allowed me to build complex, beautiful UI with minimal code. I highly recommend it to any Android developer looking to streamline their development process, since it’s nothing but ….

--

--

Priyansh Agarwal
Developer Students Club, VJTI

Anrdoid Enthusiast | Currently pursuing Computer Engineering at Veermata Jijabai Technological Institute (VJTI)