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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.