# How to Transition from XML (Android View) to Jetpack Compose View > Moving from XML to Jetpack Compose helps developers write cleaner, faster and more modern UI code — essential for staying up to date with Android’s best practices. - URL: https://lokahq.github.io/tech-blog/how-to-transition-from-xml-android-view-to-jetpack-compose-view/ - Type: Blog article - Authors: Gabriel Menezes da Silva (Senior Mobile Developer) - Published: 2025-06-23 - Updated: 2026-09-30 - Reading time: 4 min - Tags: Android, Jetpack Compose, Android Views - Originally published on Medium: https://medium.com/loka-engineering/how-to-transition-from-xml-android-view-to-jetpack-compose-view-eb5fb6a39c2a --- For many years, Android View (XML) was the sole way of building layouts in Android. In 2021, Google released Jetpack Compose, which is now the method most recommended by Google for building layouts. Android View uses the syntax of XML; Compose uses a syntax similar to React. Right now XML is still widely used for several reasons: - **Longevity:** Jetpack Compose is very new, while the XML approach has been used since the creation of Android frameworks, making it well-established and familiar for many developers. - **Developer familiarity:** More developers know Android XML than Jetpack Compose. - **Legacy projects:** Many existing Android projects are built using XML layouts, so understanding it is still a necessity. But Jetpack Compose offers a lot of advantages over XML: - **Declarative UI:** It’s easier to describe and understand how the UI works. - **Kotlin-First:** Compose is built using Kotlin, so it leverages language features and makes performance better. - **Preview and tooling:** Compose offers powerful preview features in Android Studio, allowing developers to see UI changes in real time without running the app. - **Simplified Code:** Compose requires less code compared to XML layouts, resulting in more concise and readable UI definitions. In the ideal world, we could transform all of our XML code to Jetpack Compose to harness the benefits of the newer methodology. In reality this transition can create a lot of problems, so it must be done slowly. Below are instructions for managing this gradual transition using both approaches at the same time. This way you can leverage all the benefits of Jetpack Compose while simultaneously delivering features for your clients. ## Development Here’s a simple login screen built using the old XML approach**:** ```xml