Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Login

Register Now

Welcome to All Test Answers

Android How to Program Chapter 06 Solution Manual


 

Download  file with the answers

If you are not a member register here to download this file 


 

6 Flag Quiz Game App
Objec t ives
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.
2 Chapter 6 Flag Quiz Game App
Self-Review Exercises
6.1 Fill in the blanks in each of the following statements:
a) Files in the assets folders are accessed via an (package android.content.
res), which can provide a list of all of the file names in a specified subfolder of
assets and can be used to access each asset.

b) A animation moves a View within its parent.

c) By default, animations in an animation set are applied in parallel, but you can use the
attribute to specify the number of milliseconds into the future at which an
animation should begin. This can be used to sequence the animations in a set.

d) To access the app’s assets folder’s contents, a method should get the app’s AssetManager
by calling method (inherited indirectly from class ContextWrapper).

e) A is a set of styles that specify the appearance of a GUI’s components.

6.2 State whether each of the following is true or false. If false, explain why.
a) We use AnimationUtils static method loadAnimation to load an animation from an
XML file that specifies the animation’s options.

b) Android does not provide a logging mechanism for debugging purposes.

built-in logging mechanism, which uses a circular buffer to store the messages
for a short time.
c) ImageView attribute android:adjustViewBounds specifies whether or not the ImageView
maintains the aspect ratio of its Drawable.

d) You load color and String array resources from the colors.xml and strings.xml files
into memory by using the Activity’s Resources object.

Exercises
6.3 Fill in the blanks in each of the following statements:
a) When the user selects an item from a Menu, Activity method is called to
respond to the selection.

b) To delay an action, we use a (package android.os) object to execute a Runnable
after a specified delay.

c) We also specify the number of times an animation should repeat with Animation method
and perform the animation by calling View method startAnimation
(with the Animation as an argument) on the ImageView.

d) An is a collection of animations which make up a larger animation.

e) Android supports animations which allow you to animate any property of
any object.

3
f) For the android:fromXDelta attribute, specifying the value -5%p indicates that the View
should move to the by 5% of the parent’s width (indicated by the p).

g) We use the attribute of the application element to apply a theme to the
application’s GUI.

6.4 State whether each of the following is true or false. If false, explain why.
h) You can use the android:screenOrientation attribute to specify that an app should always
appear in landscape mode (that is, a vertical orientation).

i) You specify the number of times an animation should repeat with Animation method
repeatCount.

About

Leave a reply

Captcha Click on image to update the captcha .

error: Content is protected !!