Bring some declaration in your code!

Awesome ain’t it?

Enrico Ori
TheOtherDev/s
Published in
2 min readOct 28, 2020

--

Just joking! But believe me, under the hood of this very simple application there’s a whole new world to explore: Jetpack Compose.

Jetpack Compose is a new way to develop apps in Android. Similarly to iOS’s SwiftUI it’s a toolkit for building native UI and creating apps following the declarative programming approach. Forget endless .xml layout files’ lists. It’s all done via code. Relatively easy tasks like button styling, lists writing, and the like can now be performed more easily, and also need less code to be written.

I know what you might be thinking right now: “Wait, it looks cool, but it only allows you to create masterpieces like the one above, doesn’t it?”. The answer is “Absolutely not”, Jetpack Compose Alpha is already equipped with a lot of features, like Animations, Material UI Components and Theming. You can even start adding composable functions to your existing code with the interoperability with Views. Take a sneak peak at the samples below made by Google to show the full capabilities of Jetpack Compose. These are examples of amazing UIs created easily through Jet Compose. Nothing to do with my sample above! I really invite you to have a look at these Google samples.

From Android Developers Blog

Unfortunately it is not yet intended to replace “real” native development as it is in “alpha” state now and you can only try it using the latest Canary version of Android Studio. However it’s a little sap of what the future of Android development could be. We should be very thankful that Google FINALLY decided to give us a release window for the 1.0 release: 2021 (if the world is still intact…).

Have a look at this article from Android Developers Blog and, if you’re really keen on this topic, start this starting tutorial and prepare for changing your mindset in favor of declarative programming.

--

--

Enrico Ori
TheOtherDev/s

Just like the priest of Age Of Empires, I want an army of developers with me!!