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
Computer Science
Q:
(True/False) Like other resources, style resources are placed in the app's res/values folder. When you create a project, the IDE creates a styles.xml file containing predefined styles. Each new style you create specifies a name that's used to apply that style to GUI components and one or more items specifying property values to apply.
Q:
Why would you double click strings.xml in the res/values folder?
Q:
When we need a database operation's results in the GUI thread, we"ll use a subclass of ________ (package android.os) to perform the operation in one thread and receive the results in the GUI thread.
Q:
(True/False) You should perform long-running operations or operations that block execution until they complete (e.g., file and database access) in the GUI thread.
Q:
SQLite is one of the world's most widely deployed database engines. Database queries are performed with Structured Query Language (SQL) and query results are managed via a ________ (package android-.database).
Q:
(True/False) You can use a CursorAdapter (package android-.widget) to display the results of a database query in a List View.
Q:
(True/False) When a Fragment's primary task is to display a scrollable list of items, you can extend class ListFragment. A ListFragment uses a ListView as its default layout.
Q:
(True/False) By default TextViews do not have a border.
Q:
(True/False) You can define common GUI component attribute"value pairs as styleresources. You can then apply the styles to all components that share those values by using the style attribute. Any subsequent changes you make to a style are automatically applied to all GUI components.
Q:
(True/False) When an app is simply placed into the background, perhaps so the user can answer a phone call or when the user starts another app, the app must save the contents of its GUI components for when the app is brought back to the foreground (provided that the system does not kill the app).
Q:
Method ________ is called by the system when the configuration of the device changes during the app's executionfor example, when the user rotates the device or slides out a keyboard on a device with a hard keyboard. This method can be used to save state information that you"d like to restore when the app's onCreate method is called as part of the configuration change.
Q:
Typically, each Fragment defines an interface of ________ that are implemented in the host Activity.
Q:
(True/False) To communicate data between Fragments and a host Activity or the Activity's other Fragments, it's considered best practice to do so through the root Fragment.
Q:
You"ll use Android's ________a data structure that stores Fragments in last-in-first-out (LIFO) order-to provide automatic support for the Android system bar's back button and to allow the app to remove Fragments in the reverse order from which they were added.
Q:
Which of the following statements is false?
a. You can declare each Fragment in an Activity's layout or, for a DialogFragment, call its show method to create it.
b. An app can use multiple activities to host an app's Fragments on a phone device.
c. You can use only one Activity to host all of an app's Fragments.
d. On a phone-sized device, you"ll typically display several Fragments at a time.
Q:
Method onProgressChanged is called when the position of a SeekBar's ________ changes.
Q:
When the ColorDialogFragment is added to a parent Activity, method ________ is called.
Q:
Color's static methods alpha-, red, green and blue extract the ARGB values from the color, and SeekBar's ________ method positions the thumbs.
Q:
PrintHelper method printBitmap displays Android's print dialog, which allows the user to choose whether to save the image as a ________ on the device or to print the image to an available printer.
Q:
(True/False) Store the image in the device's Gallery by calling class MediaStore.Images.Media's insertImage method. Method insertImage returns a String representing the image's location on the device, or null if the image could not be saved.
Q:
(True/False) The system MotionEvent passed from onTouchEvent contains touch information for multiple moves on the screen if they occur at the same time. MotionEvent method getPointerCount returns the number of touches the Motion-Event describes.
Q:
Call Path's ________ method to set the Path's starting coordinates and specify the new Point's x and y values.
Q:
Which of the following statements is false?a. Motion-Event's getActionMaskedmethod returns an int representing the MotionEvent type, which you can use with constants from class MotionEvent to determine how to handle each event.b. Motion-Event's getActionIndex method returns an integer index representing which finger caused the event. This index is the finger's unique ID.c. To get the finger's unique ID that persists across MotionEvents until the user removes that finger from the screen, we"ll use Motion-Event's getPointerID method, passing the finger index as an argument.d. If the action is MotionEvent.ACTION_DOWN or Motion Event.ACTION_POINTER_DOWN, the user touched the screen with a new finger.
Q:
Which of the following statements is false?
a. Method onTouchEvent is called when the View receives a touch event.
b. Android supports multitouchthat is, having multiple fingers touching the screen.
c. The user must maintain the same number of fingers touching the screen for the duration of the multitouch event.
d. Each fingerknown as a pointerhas a unique ID that identifies it across touch events.
Q:
SimpleOn-Gesture-Listener is an ________ class that implements interfaces On Gesture Listener and On Double Tap-Listener.
Q:
When a View needs to be redrawn, its onDraw method is called. The first argument is the Bitmap to draw, the next two arguments are the x-y coordinates where the upper-left corner of the Bitmap should be placed on the View and the last argument is the ________ object that specifies the drawing characteristics.
Q:
Why would you call the inherited View method invalidate?
Q:
Which of the following statements is false?a. Bitmap's static createBitmap method creates a Bitmap of the specified width and height.b. The last argument to createBitmap is the Bitmap's encoding, which specifies how each pixel in the Bitmap is stored. The constant Bitmap.Config.ARGB_8888 indicates that each pixel's color has a default value of 8 for the alpha, red, green and blue components.c. A Canvas is used to draw shapes directly to a Bitmap.d. You can use Bitmap's eraseColor method to fill the Bitmap with white pixels.
Q:
Why would you call Paint's setStrokeCap method with Paint.Cap.ROUND?
Q:
(True/False) You set a line's width using Paint's setLineWidth method.
Q:
Why would you pass true to Paint's setAntiAlias method?
Q:
When processing a menu selection you use the MenuItem's ________ method to get the resource ID of the selected menu item, then take appropriate actions based on the selection.
Q:
(True/False) When the user selects a menu item, Fragment method on OptionsItemSelected responds to the selection.
Q:
It's important to handle sensor events quickly or to copy the event data because ________.
Q:
Why would you provide an empty body for a method?
Q:
We override SensorEventListener method ________ to process accelerometer events.
Q:
You register to receive accelerometer events using SensorManager's registerListener method. One of its arguments is the rate at which sensor events should be delivered to the app. Why would you specify SENSOR_DELAY_NORMAL to receive sensor events at the default rate, instead of choosing a faster rate?
Q:
SensorManager's GRAVITY_EARTH constant represents ________.
Q:
(True/False) Like an Activity, a Fragment can place items in the app's action bar and options menu. To do so, the Fragment must call its setHasOptionsMenu method with the argument true.
Q:
(True/False) One problem with using a shake event is that even unintentional small movements always result in events.
Q:
What does the following code do?
if (screenSize == Configuration.SCREENLAYOUT_SIZE_XLARGE)
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
else
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
Q:
The Android Support Library is a set of libraries that are commonly used to provide new Android features for use in older Android versions.
Q:
Class ________ provides a user interface for selecting a printer, has a method for determining whether a given device supports printing and provides a method for printing a Bitmap.
Q:
The ________ manages media files (images, audio and video) stored on a device.
Q:
The default location in which photos taken with the device are stored is the device's ________.
Q:
(True/False) A GestureDetector allows an app to react to user interactions such as flings, single taps, double taps, long presses and scrolls by implementing the methods of interfaces GestureDetector.OnGestureListener and Gesture-Detector.On-Double-Tap-Listener interfaces.
Q:
Android's full-screen immersive mode enables an app to take advantage of the entire screen, but still allows the user to access the ________ when necessary.
Q:
You use the type of a ________ to determine whether the user has touched the screen, dragged across the screen or lifted a finger from the screen.
Q:
(True/False) You process touch events by overriding the View method on Touch Event.
Q:
(True/False) You can associate a Canvas with a Bitmap, then use the Canvas to draw on the Bitmap, which can then be displayed on the screen. A Bitmap can also be saved into a file.
Q:
The last Fragment lifecycle method called when a Fragment is about to be detached from a parent Activity is ________.
Q:
The first Fragment lifecycle method called when a Fragment is attached to a parent Activity is ________.
Q:
(True/False) Alert Dialogs are often created using anonymous inner classes that extend DialogFragment and display only text and buttons. AlertDialogs may also contain custom Views.
Q:
Most Android devices have a(n) ________ that allows apps to detect movement.
Q:
An ARGB color contains ________ (transparency), ________, ________ and ________ componnts.
Q:
With Android's ________ you can draw on the entire screenthe device's system bars and action bar toggle between displayed and hidden when you tap the screen.
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.