5.1. Introduction

The Flag Quiz app tests your ability to correctly identify 10 country flags (Fig. 5.1). Initially, the app presents a flag image and three guess Buttons representing the possible country answers—one matches the flag and the others are randomly selected, nonduplicated incorrect answers. The app displays the user’s progress throughout the quiz, showing the question number (out of 10) in a TextView above the current flag image. As you’ll see, the app also allows you to control the quiz difficulty by specifying whether to display three, six or nine guess Buttons, and by choosing the world regions that should be included in the quiz. These options are displayed differently based on the device that’s running the app and the orientation ...

Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.