Accounting
Anthropology
Archaeology
Art History
Banking
Biology & Life Science
Business
Business Communication
Business Development
Business Ethics
Business Law
Chemistry
Communication
Computer Science
Counseling
Criminal Law
Curriculum & Instruction
Design
Earth Science
Economic
Education
Engineering
Finance
History & Theory
Humanities
Human Resource
International Business
Investments & Securities
Journalism
Law
Management
Marketing
Medicine
Medicine & Health Science
Nursing
Philosophy
Physic
Psychology
Real Estate
Science
Social Science
Sociology
Special Education
Speech
Visual Arts
Programming Language
Q:
(True/False) You want to ensure that the game operates at the same speed regardless of how fast the device is. If the time between frames is larger (i.e., the device is slower), the game elements should move less when each frame of the animation is displayed. If the time between frames is smaller (i.e., the device is faster), the game elements should move further when each frame of the animation is displayed.
Q:
Only one thread at a time can draw to a SurfaceView. To ensure this, you must first lock the SurfaceHolder by specifying it as the expression in the parentheses of a __________ block.
Q:
We override View method onTouchEvent to determine when the user touches the screen. We use MotionEvent's getAction method to determine whether the user touched the screen (MotionEvent.ACTION_DOWN) or ________ (MotionEvent.ACTION_MOVE).
Q:
The first two arguments of Canvas's drawCircle method represent the ________. The third argument is the circle's radius. The last argument is the Paint object specifying the circle's drawing characteristics.
Q:
Canvas's drawRect method receives as arguments the rectangle's upper-left x-y coordinates, the rectangle's width and height, and the ________ object that specifies the drawing characteristics.
Q:
Class View's ________ method is called whenever the View's size changes, including when the View is first added to the View hierarchy as the layout is inflated.
Q:
(True/False) SparseIntArray is similar tobut less efficient thana HashMap<Integer, Integer> for small numbers of key"value pairs.
Q:
The Android documentation for class SoundPool recommends using the stream for playing music (________) for sound in games.
Q:
(True/False) A SoundPool can play only one sound stream at once.
Q:
(True/False) Inherited SurfaceView method get Holder returns the SurfaceHolder object for managing the SurfaceView, and SurfaceHolder method addCallback stores the object that implements interface SurfaceHolder.Callback.
Q:
When a View is inflated, its constructor is called with a(n) ________ and an AttributeSet as arguments.
Q:
(True/False) Method onCreateView is called after a Fragment's onCreate method to build and return a View containing the Fragment's GUI. Method onActivityCreated is called after the Fragment's host Activity is created.
Q:
(True/False) Sound files are stored in the app's res/raw folder.
Q:
(True/False) A FrameLayout is designed to display many Views.
Q:
Each drawing method in class Canvas uses an object of class ________ (package android.graphics) to specify drawing characteristics, including color, line thickness, font size and more.
Q:
We use methods of class Canvas (package android.graphics) to draw text, lines and circles. Canvas methods draw on a View's ________.
Q:
Game-development frameworks typically provide sophisticated "________-perfect" collision-detection capabilities.
Q:
You manipulate a SurfaceView via an object of class SurfaceHolder, which enables you to obtain a Canvas on which you can draw graphics. Class SurfaceHolder also provides methods that give a thread ________ access to the Canvas for drawingonly one thread at a time can draw to a SurfaceView.
Q:
Games often require complex logic that should be performed in separate threads of execution (that is, separate from the GUI thread) and those threads often need to draw to the screen. For such cases, Android provides class ________a subclass of View to which a thread can draw, then indicate that the results should be displayed in the GUI thread.
Q:
In Android, it's important to minimize the amount of work you do in the GUI thread to ensure that the GUI remains responsive and does not display ________ dialogs.
Q:
(True/False) The Android documentation recommends that games use the music audio stream to play sounds.
Q:
An app's sound effects are managed with a ________ (package android.media), which can be used to load, play and unload sounds.
Q:
To process simple touch events, you"ll override View method onTouchEvent, then use constants from class ________ (package android.view) to test which type of event occurred and process it accordingly.
Q:
Which of the following statements is false?
a. When an Activity hosts Fragments and the Activity is paused, you must call all of its Fragments' onPause methods.
b. We override onPause to suspend play in a game so that the game does not continue executing when the user cannot interact with itthis saves battery power.
c. When an Activity is shut down, its onDestroy method is called, which in turn calls the onDestroy methods of all the Fragments hosted by the Activity.
d. We can use method onDestroy in a game Fragment to release various game resources resources.
Q:
Which of the following statements is false?
a. When a Fragment is attached to an Activity, its lifecycle is tied to that of its parent Activity.
b. There are six Activity lifecycle methods that have corresponding Fragment lifecycle methodsonCreate, onStart, onResume, onPause, onStop and onDestroy.
c. When the system calls any of the methods onCreate, onStart, onResume, onPause, onStop and onDestroy on an Activity, it will also call these corresponding methods (and potentially other Fragment lifecycle methods) on only the Activity's attached primary Fragment.
d. An Activity's onPause method is called when another Activity receives the focus, which pauses the one that loses the focus and sends it to the background.
Q:
(True/False) Media files, such as the sounds, are placed in the app's resource folder res/raw.
Q:
To add a custom component to a layout's XML file, you must provide its class name.
Q:
You can create a customview by extending class ________ or one of its subclasses.
Q:
Each Activity in an app must be declared in the app's ________ file; otherwise, Android will not know that the Activity exists and will not be able to launch it.
Q:
(True/False) The DialogFragment's onCreateDialog method uses an ________ to configure and create an AlertDialog, then returns it.
Q:
(True/False) Log static method e is used to log error messages.
Q:
(True/False) IOExceptions are unchecked exceptions.
Q:
(True/False) Activity is an indirect subclass of Context.
Q:
LayoutInflater's inflate method returns ________.
Q:
You can use a ________ object to perform an action after a delay.
Q:
Toast method makeText receives as arguments the Context on which the Toast is displayed, the message to display and the ________. Toast method show displays the Toast.
Q:
Method ________ is called when a menu item is selected.
Q:
Returning true from onCreateOptionsMenu indicates that ________.
Q:
We use the WindowManager to get a Display object that contains the screen's current width and height, which changes based on the ________.
Q:
(True/False) We override Activity method onCreateOptionsMenu to initialize Activity's standard options menu.
Q:
(True/False) When an app first executes, overridden Activity lifecycle method onStart is before after onCreate.
Q:
Resources method getConfiguration returns a Configuration object (package android.content.res) that contains public instance variable screenLayout, which you can use to determine the device's ________.
Q:
Inherited method getResources returns the app's Resources object (package android.content.res) that can be used to ________ and determine information about the app's environment.
Q:
________ method getDefaultSharedPreferences returns a reference to the SharedPreferences object representing the app's preferences, and SharedPreferences method registerOnSharedPreferenceChangeListener registers the listener.
Q:
Android chooses the activity_main.xml file from the ________ folder if the app is running in portrait orientation or ________ if the app is running on a tablet in landscape orientation.
Q:
(True/False) By default, animations in an animation set are applied sequentially (i.e., one after the other).
Q:
For the android:toXDelta attribute, if we specify the value -5%p, it indicates that the View should move to the ________ (due to the minus sign) by 5% of the parent's width (indicated by the p).
Q:
(True/False) The android:fromXDeltaattribute is the View's offset when a translate animation starts and the android:toXDeltaattribute is the View's offset when the animation ends.
Q:
Which of the following statements is false?a. An animation set is a collection of animations that make up a larger animation.b. Property animation types include alpha (transparency), scale (resize), translate (move) and rotate.c. A translate animation moves a View within its parent.d. Property animations can animate any property of any object.
Q:
The PreferenceFragment property ________ specifies the name of a preference stored in the app's SharedPreferences.
Q:
The property ________, when set to true, causes a PreferenceFragment to store a preference's value each time it changes.
Q:
(True/False) The qualifiers large and land ensure that any layouts defined in a particular folder will be used only on large devices on which the app is running in landscape orientation.
Q:
For each Fragment layout, you"ll add a layout XML file to your app's ________ and specify which Fragment class the layout is associated with.
Q:
(True/False) All of an app's Fragments must use the same layout.
Q:
(True/False) Font sizes should be specified in scale-independent pixels (sp) so that fonts in your app can also be scaled by the user's preferred font size (as specified in the device's settings).
Q:
(True/False) Typically, colors are defined in a file named colors.xml, which Android creates for you.
Q:
Why should color resources be defined in XML?
Q:
(True/False) All of your app's resources in the res/values folder must be defined in specific files based on the type of the resourcesfor example, array resources must be defined in arrays.xml, colors in colors.xml, Strings in strings.xml and numeric values in values.xml.
Q:
(True/False) When a String resource contains multiple format specifiers you must number the format specifiers for localization purposes. A d in a format specifier formats an integer; an f in one formats a floating-point number.
Q:
(True/False) Suppose your app dynamically loads image file names and stores them in an ArrayList<String>. You can use Collections method randomize to shuffle the order of the image file names for each new game.
Q:
(True/False) When exceptions occur, you can log them for debugging purposes with Android's built-in logging mechanism. Android provides class Log with several static methods that represent messages of varying detail.
Q:
Which of the statements in a), b) and c) is true?a. You can perform a shake animation by applying an Animation to an ImageView.b. We use AnimationUtils static method load Animation to load the animation from an XML file that specifies the animation's options.c. We can specify the number of times an animation should repeat with Animation method setRepeatCount and perform the animation by calling View method startAnimation (with the Animation as an argument) on the ImageView.d. Statements a), b) and c) are all true.
Q:
Which of the following statements is false?
a. You can make your app to display something for a few seconds then move on by using a Handler.
b. Handler method postDelayed receives as arguments a Runnable to execute and a delay in milliseconds.
c. After the delay has passed, the Handler's Runnable executes in the same thread that created the Handler.
d. Operations that interact with or modify the GUI must be performed in the GUI thread, because GUI components are thread safe.
Q:
(True/False) A Toast displays a message that remains on the screen until the user dismisses it. Toasts are often used to display minor error messages or informational messages.
Q:
(True/False) We can use Android's WindowManager to obtain a Display object that contains the display's current width and height. This changes with the device's orientationin portrait orientation, the device's height is less than its width.
Q:
For an app's MainActivity, you can use size and orientation qualifiers to determine which layout to use. The MainActivity layout activity_main.xml in a project's res/layout-large-land folder is used only on ________ devices (i.e., tablets) when the app is in ________ orientation.
Q:
(True/False) You typically provide images and other visual resources in the highest available resolution so Android can scale each appropriately for each particular device's pixel density.
Q:
(True/False) Resource subfolder names that begin with other contain XML files that do not fit into the other resource categories. These are often raw XML data files used by the app.
Q:
(True/False) Resource subfolder names that begin with menu contain XML files that describe the contents of menus. When you create a project, the IDE automatically defines a menu with a Settings option.
Q:
Resource subfolder names that begin with ________ contain resource files (such as audio clips) that are read into an app as streams of bytes.
Q:
(True/False) Resource subfolder names that begin with color contain XML files that define a list of colors for various states, such as the states of a Button (unpressed, pressed, enabled, etc.).
Q:
In Java, a property is typically implemented in a class as an instance variable with both ________.
Q:
Resource subfolder names that begin with animator contain XML files that define ________, which change the value of a property of an object over time.
Q:
Resource subfolder names that begin with anim contain XML files that define ________, which can change an object's transparency, size, position and rotation over time.
Q:
(True/False) Unlike an app's drawable folders, which require their image contents to be at the root level in each folder, the assets folder may contain files of any type and they can be organized in subfolders.
Q:
A List Preference's items are ________, whereas any number of items can be selected in a Multi Select List Preference.
Q:
If the Activity needs to interact with a Fragment that's declared in the Activity's layout and has an Id, the Activity can call FragmentManager method ________ to obtain a reference to the specified Fragment.
Q:
A parent Activity manages its Fragments with a ________ that's returned by the Activity's getFragmentManager method.
Q:
Which of the following statements is false?
a. Unlike activities, Fragments do not have lifecycles.
b. The onCreatemethod is called when a Fragment is created.
c. The onCreateViewmethod is called after onCreate to build and return a View containing the Fragment's GUI.
d. The onCreateView method receives a LayoutInflater, which you"ll use to programmatically inflate a Fragment's GUI from the components specified in a predefined XML layout.
Q:
(True/False) Fragments can be hosted by an Activity, or they can execute independently.