O'Reilly logo

Android Programming: The Big Nerd Ranch Guide by Brian Hardy, Bill Phillips

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

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 ...

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