O'Reilly logo

Android UI Design by Jessica Thornsby

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building your UI – XML or Java?

The easiest way of defining your user interface (and the views, ViewGroups, and layout elements that it contains) is via your project's XML file.

Declaring your UI with XML

Android provides a straightforward XML vocabulary that gives your user interface a human-readable structure, and creates a separation between the code that defines your UI and the code that controls your app's behavior. You define your layouts in XML in a dedicated layout resource file. This helps to keep both sets of code cleaner, and it gives you the ability to tweak and refine your UI without having to touch your app's underlying code. For example, you can update your layout to support an additional language without having to touch the previously-tested ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required