O'Reilly logo

Android How to Program by Paul Deitel, Abbey Deitel, Harvey Deitel

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

6. Flag Quiz Game App

Objectives

In this chapter you’ll:

• Store String arrays in strings.xml.

• Store a set of images in subfolders of the assets folder.

• Use an AssetManager to get a list of all assets in an app.

• Use random-number generation to vary flag choices.

• Use a Drawable to display a flag image in an ImageView.

• Use a tweened animation to shake the displayed flag when the user specifies an incorrect answer.

• Use a Handler to schedule a future action.

• Use an ArrayList to hold collections of items and a HashMap to hold name–value pairs.

• Override Activity’s onCreateOptionsMenu method to create a Menu and MenuItems that enable the user to configure the app’s options.

• Use Android’s logging mechanism to log error messages.

Outline ...

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