O'Reilly logo

Hello, Android, 4th Edition by Ed Burnette

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

Designing in XML

There are two ways to define a user interface in Android: in code, or in XML. XML is usually recommended because it’s easier to create and style than the equivalent Java code.

Android Studio has a graphical layout editor to help you create beautiful user interfaces by dragging and dropping components such as buttons and lists onto a canvas, and then positioning them with your mouse. You should play around with the editor and use it whenever you like, but for this book we’re just going to work with the XML text that it creates. This will give you a better feel for how things work.

Creating the Main Screen

When users start the program, we want to show options for continuing a game, starting a new game, and for reading about what ...

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