2Android and Model-View-Controller

In this chapter, you are going to upgrade the GeoQuiz app to present more than one question.

Figure 2.1  More questions!

More questions!

To make this happen, you are going to add a class named TrueFalse to the GeoQuiz project. An instance of this class will encapsulate a single true-false question.

Then, you will create an array of TrueFalse objects for QuizActivity to manage.

Creating a New Class

In the package explorer, right-click the com.bignerdranch.android.geoquiz package and select NewClass. Name the class TrueFalse, leave its superclass as java.lang.Object, and click Finish.

Figure 2.2  Creating the TrueFalse class ...

Get Android Programming: The Big Nerd Ranch Guide 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.