In this post, I wanna talk to you, little dev, who’s diving into Android Native Development.

When we’re getting started with a new stack, at some point we start asking ourselves whether the technology we’ve chosen is really worth learning.
Note: The terms XML and Views are used intercheangebly in this post.
You spend hours browsing WhatsApp, Telegram, and Discord groups related to Android, asking for guidance. And then, the answers start pouring in:
“Yeah, XML is trash – go straight to Compose.”
“No, Compose isn’t mature enough for production – stick with XML”
“Forgot XML, use it only for string resources”
And a lot of answers from people with a career background so much different from yours. To be honest? You’re not asking for guidance, you’re asking what technology will put you into the market, right? If this is your main quest, I’ll tell you what you should do.
TLDR; Start with XML to practice another concepts like OOP and view lifecycles as well.
Explanation: Why should you start with XML instead of Compose?
There are two main reasons related to learning: Object Orientation Programming (OOP) and Components Lifecycle, as well as a reason related to career: legacy projects.
If you’re getting started in programming, probably don’t know much about OOP on practice. You certainly have been studying the concepts and knows about it, but check how it is being used on real world is really game changing. The current Android System is written majoritary in Java, following OOP, as you can see in AOSP source code at cs.android.com/…/view/, and it stands his shoulder in OOP programming. When programming with views you probably would need to lock inside an inherited Java class to see how it is behaving.
Things like implementing a list with RecyclerView would require you to inherit from classes like ViewHolder and Adapters. To create your own custom view button, you probably would need to know how to inherit the Button class as well. You’ll have a lot more practice with OOP using views. In Compose, most of the OOP practice you would have is to inherit your MainActivity and a ViewModel (if using one).
Sure, if you already really know about OOP, it is not intended to work for a company and instead would like to do your own freelance projects, maybe Compose is better because it really accelerates and simplifies the development. But the truth is: You can’t call yourself an Android developer without ever having touched the view system before.
Another reason is: There are a lot of XML projects over there. In my first job opportunity, I worked a lot not with XML but with Java 8 as well. Sometimes, the time spent migrating technologies is not worth it, so we stick to maintaining legacy projects. If you start your career in a company that’s using 100% Compose, without a single line of XML, dude… you’re very, very lucky.
You are on your day 1. People who say “Starts with Compose, XML is too painful” are probably on their day 1000 and have written a lot of XML / Views code throughout their journey. They probably have a solid foundation that you don’t have.
Best Regards.