Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. Flag Quiz Game App: Assets, A... > Building the App’s GUI and Resource ...

6.4. Building the App’s GUI and Resource Files

In this section, you’ll build the GUI for the Flag Quiz Game app. You’ll create a second XML layout that will be dynamically inflated to create the country-name Buttons that represent each quiz question’s possible answers. You’ll also create an XML representation of the shake animation that’s applied to the flag image when the user guesses incorrectly.

6.4.1. main.xml LinearLayout

In this app, we use main.xml’s default vertical LinearLayout. Figure 6.7 shows the app’s GUI component names. Recall that, for clarity, our naming convention is to use the GUI component’s class name in each component’s Id property in the XML layout and in each variable name in the Java code.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint