Deck 4: Flag Quiz App

Full screen (f)
exit full mode
Question
In what thread does a Handler's Runnable execute?

A) the GUI thread
B) the thread that created the Handler
C) a new thread that the Handler creates
D) None of the above
Use Space or
up arrow
down arrow
to flip the card.
Question
You can provide String resources for different languages and regions. Android uses resource folders with ________ to choose the appropriate images, based on a device’s pixel density, and the correct language strings, based on a device’s locale and region settings.

A) qualified names
B) disqualified names
C) unqualified names
D) None of the above.
Question
An object of class ________ contains public instance variable orientation containing either ORIENTATION_PORTRAIT or ORIENTATION_LANDSCAPE for the device's current orientation.

A) Settings
B) Configuration
C) Orientation
D) None of the above
Question
Method onCreateView is called after onCreate to build and return a View con-taining the Fragment’s GUI. This method receives a(n) ________, which you’ll use to programmatically inflate a Fragment’s GUI from the components speci-fied in a predefined XML layout.

A) Inflater
B) GUICreator
C) GUIInflater
D) LayoutInflater
Question
When the user selects a menu item, Activity method ________ responds to the selection.

A) onItemSelected
B) onOptionsItemSelected
C) onOptionSelected
D) onMenuItemSelected
Question
Resource folder names that begin with anim contain XML files that define ________, which can change an object's transparency, size, position and rotation over time.

A) property
B) tweened
C) view
D) drawable
Question
Which of the following statements is false?

A) A Fragment typically represents a reusable portion of an Activity’s user in-terface, but may also represent reusable program logic.
B) Like an Activity, each Fragment has its own layout that’s typically defined as an XML layout resource file (GUIs also can be created dynamically).
C) You can create an XML file describing the user preferences, then class PreferenceFragment can use that file to build an appropriate preferences GUI.
D) Fragments can be hosted by an Activity or they can execute independently
Question
You specify the number of times an animation should repeat with Animation method ________.

A) setRepetitions
B) repetitions
C) setRepeatCount
D) repeatCount
Question
In Java, a property is typically implemented in a class as a(n) ________.

A) static method
B) instance variable with both set and get accessors
C) non-static method
D) enumeration
Question
Which of the following statements is false?

A) You can use a color state list to define separate colors for when Buttons are enabled or disabled.
B) Resource folder names that begin with raw contain resource files (such as audio clips) that are read into an app as streams of bytes. You use such resources to play sounds.
C) Resource folder names that begin with xml contain XML files that do not fit into the other resource categories-often XML data files used by the app.
D) All of the above are true.
Question
Handler- method ________ receives as arguments a Runnable to execute and a delay in milliseconds. After the delay has passed, the Handler’s Runnable exe-cutes in the same thread that created the Handler.

A) executeDelayed
B) runDelayed
C) handleDelayed
D) postDelayed
Question
You can use the ViewAnimationUtils class to create a circular reveal Animator object by calling the createCircularReveal method. The animation appears as a --------________ circular window that displays part of a UI element.

A) rotating
B) shrinking
C) expanding
D) shrinking or expanding
Question
You override Activity method ________ and use the method's Menu argument to add the menu items-either programmatically or by inflating an XML document that describes the menu items.

A) on-Create-Menu
B) on-Create-OptionsMenu
C) on-OptionsMenuOpened
D) on-MenuOpened
Question
You must interact with a ________ dialog to dismiss it.

A) error
B) non-modal
C) modal
D) information
Question
You could define a ________ for a Button's background color that specifies different colors for the Button's pressed, unpressed, enabled and disabled states.

A) color state list
B) color list
C) color group
D) color state group
Question
Files in the assets subfolders are accessed via an ________, which can provide a list of all of the file names in a specified subfolder and can be used to access each asset.

A) FolderManager
B) Organizer
C) AssetOrganizer
D) AssetManager
Question
________ are often used to display minor error messages or informational messages that disappear after a short period of time.

A) Tweets
B) Tooltips
C) Toasts
D) None of the above
Question
Resource folder names that begin with ________ contain XML files that define property animations, which change the value of an object’s property over time.

A) animator
B) anim
C) animation
D) None of the above.
Question
Which of the following statements is false?

A) A PreferenceFragment uses Preference objects to manage app settings and stores those settings in a file via a SharedPreferences object.
B) A ListPreference creates checkboxes in which only one can be selected.
C) A MultiSelectListPreference creates a GUI containing checkboxes, any number of which can be selected.
D) To modify a SharedPreferences file’s contents, you’ll use a SharedPref-erences.Editor object.
Question
A FragmentManager can use ________ to dynamically add, remove and transition between Fragments.

A) Transactions
B) FragmentTransactions
C) FragmentTransitions
D) Transitions
Question
If multiple activities can handle the action and data passed to startActivity, the system will ________.

A) display a dialog in which the user can select the activity to use
B) choose the first matching Activity
C) select a random Activity
D) None of the above
Question
An Activity is launched by using a(n) ________ that indicates an action to be performed and the data on which to perform that action.

A) Action
B) IntendedAction
C) Launcher
D) Intent
Question
Which of the next three statements is false?

A) When exceptions occur or when you want to track important aspects of your code’s execution, you can log messages for debugging purposes with Android’s built-in logging mechanism.
B) Android provides class Log (package android.util) with several static methods that represent messages of varying detail.
C) Logged messages can be viewed in the bottom of the Android Device Moni-tor’s LogCat tab or with the Android logcat tool.
D) Each of the above statements is true.
Question
If the system cannot find an activity to handle an Intent’s action, then method startActivity throws an Activity-NotFound-Exception. You can prevent this exception from happening by first using Intent method ________ to de-termine whether there is an Activity to handle the Intent.

A) findActivity
B) findActivityForIntent
C) resolveActivity
D) resolveActivityForIntent
Question
When a color state list resource is provided for a Button color (either fore-ground or background), the appropriate color from the list of colors is selected, based on the Button’s ________.

A) relative horizontal position
B) importance
C) proximity to other GUI elements
D) state
Question
Select File > New > Vector Asset to display the ________—this tool enables you to add to your project any of Google’s recommended material design icons. Each icon is defined as a scalable vector graphic that smoothly scales to any size.

A) Vector Image Studio
B) Vector Asset Studio
C) Asset Studio
D) Image Studio
Question
A(n) ________ is a collection of animations that make up a larger animation.

A) animation list
B) animation set
C) animation map
D) None of the above
Question
Which of the following three statements is false?

A) The Blank Activity template is a backward-compatible app template (for An-droid 2.1 and higher) that uses features of the Android Design Support Library.
B) The Blank Activity template must be used with a Fragment.
C) When you choose to use the Fragment option, the IDE creates layouts named activity_main.xml, content_main.xml and fragment_main.xml.
D) Each of the above statements are false
Question
As with any other resource, color resources should be defined in XML so you can easily change colors without modifying your app's Java source code and so you can use Android's ________ capabilities to provide colors resources for various scenarios (different locales, night and day colors, and so on).

A) color-choosing
B) value-choosing
C) locale-choosing
D) resource-choosing
Question
Which of the following three statements is false?

A) You must create the AndroidManifest.xml file when you create an app.
B) All activities in an Android app must be listed in the app’s manifest file.
C) When you add an activity to a project, the IDE will also add it to the mani-fest file.
D) All of the above statements are false.
Question
You can force a menu item to display on the app bar, in which case it's known as a(n) ________-by default, this is displayed as the menu item's icon (if there is one).

A) task
B) button
C) action
D) None of the above
Question
The Android design guidelines indicate that text displayed in your GUI should be brief, simple and friendly with the important words ________.

A) centered
B) last
C) in italics
D) first
Question
When you choose the Blank Activity template's Fragment option, this file contains only a ________ element that displays the MainActivityFragment's GUI defined in fragment_main.xml.

A)
B)
C)
D) None of the above
Question
By convention array resources are normally defined in arrays.xml, colors in colors.xml, Strings in strings.xml and numeric values in ________.

A) numbers.xml
B) numeric.xml
C) digits.xml
D) values.xml
Question
Which of the following statements is true?

A) The default activity_main.xml layout embeds (via an element in the XML) the GUI defined in content_main.xml.
B) The default activity_main.xml layout also contains a FloatingAc-tionButton—a round image button from the Android Design Support Library that has a higher elevation than the GUI’s other components, so it “floats” over the GUI.
C) Each app based on the Blank Activity template includes a FloatingAc-tionButton (which typically emphasizes an important action that the user can perform by touching the button) and other material design features.
D) All of the above statements are true.
Question
If the Java compiler can infer a generic object's type from the context, you can replace with <> when creating the object. In this context, <> is referred to as the ________ operator.

A) type
B) less than-greater than
C) inference
D) diamond
Question
Each Activity declared in the AndroidManifest.xml file can specify ________ indicating actions the Activity is capable of handling.

A) intent extractors
B) activity filters
C) intent filters
D) None of the above
Question
Which of the following statements about a standard AlertDialog is false?

A) Its negative action button cancels the dialog’s specified action, often labeled with CANCEL- or NO. This is the leftmost button when there are multiple but-tons in the dialog.
B) Its positive action button accepts the dialog’s specified action, often labeled with OK or YES. This is the rightmost button when there are multiple buttons in the dialog.
C) Its neutral action button indicates that the user does not want to cancel or accept the action specified by the dialog. For example, an app that asks the user to register to gain access to additional features might provide a REMIND ME LATER neutral button.
D) Each of the above statements is true.
Question
You can use Collections method ________ to randomize the order of the elements in an ArrayList.

A) reorder
B) shuffle
C) srand
D) randomize
Question
Android uses a technique known as ________ to communicate information between activities within one app or activities in separate apps.

A) intent messaging
B) intent dispatching
C) intent broadcasting
D) None of the above
Question
Setting the ImageView's adjustViewBounds property to true indicates that the ImageView maintains its image's ________.

A) width
B) height
C) resolution
D) aspect ratio
Question
A ________ animation moves a View within its parent.

A) alpha
B) scale
C) rotate
D) translate
Question
By default, animations in an animation set are applied simultaneously (i.e., 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.

A) android:startTime
B) android:offset
C) android:sequence
D) android:startOffset
Question
The ________ attribute specifies how long the animation lasts in milliseconds.

A) android:duration
B) android:length
C) android:playbackTime
D) android:time
Question
By default, the IDE set the layout’s Padding Left and Padding Right properties to a predefined dimension resource named @dimen/activity_horizontal_margin—located in the ________ file of the project’s res/values folder.

A) dimensions.xml
B) values.xml
C) strings.xml
D) dimens.xml
Question
Method inflate returns a reference to a ________ that contains the inflated GUI.

A) Layout
B) Inflator
C) View
D) RelativeLayout
Question
It’s considered a best practice in Android to ensure that every GUI component can be used with TalkBack. For components that don’t have descriptive text, such as Image-Views, set the component’s ________ property.

A) description
B) contentDescription
C) talkback
D) talkbackDescription
Question
IOExceptions are ________ exceptions (so you must catch or declare the exception).

A) required
B) important
C) special
D) checked
Question
Which of the following is not a tweened animation that you can include in an animation set?

A) alpha
B) scale
C) rotate
D) flip
Question
When you install and launch an app for the first time, calling Prefer-enceManager method setDefaultValues sets the app’s default prefer-ences—this creates and initializes the app’s ________ file using the default values that you specified in preferences.xml.

A) Settings
B) Preferences
C) SharedPreferences
D) SharedSettings
Question
Setting the layout:height property to 0dp will let a View's height be determined by the ________ property.

A) layout:weight
B) layout:width
C) layout:automatic
D) None of the above
Question
You can use a(n) ________ object to delay the performance of an action.

A) DelayedAction
B) ActionHandler
C) TaskHandler
D) Handler
Question
Toast method ________ receives as arguments the Context on which the Toast is displayed, the message to display and the duration for which the Toast will be displayed. Toast method show displays the Toast.

A) makeToast
B) buildToast
C) makeText
D) buildText
Question
Which of the following statements is false?

A) When the app first executes, onCreate is called after onStart.
B) When the app is running in portrait orientation and the user opens the Set-tings-Activity, the MainActivity is stopped while the SettingsActivity is displayed. When the user returns to the MainActivity, onStart is called again.
C) To get a reference to the MainActivityFragment so we can call its methods, use inherited AppCompatActivity method getSupportFragmentManager to get the FragmentManager, then call its findFragmentById method.
D) Each of the above statements is true.
Question
It's often easiest to select a particular GUI component in ________.

A) the design area
B) the Component Tree window
C) XML
D) None of the above
Question
Method ________ is called when a menu item is selected.

A) onOptionSelected
B) onMenuItemSelected
C) onItemSelected
D) onOptionsItemSelected
Question
Method getConfiguration returns a Configuration object (package android.content.res) containing public instance variable ________, which specifies the device's screen-size category.

A) screenSize
B) size
C) layout
D) screenLayout
Question
Setting a Button's style property to @android:style/Widget.Material.Button.Colored causes the Button to take on a colored appearance, based on the colors of the app's theme. The Buttons' color will be the theme's ________.

A) accent color
B) primary color
C) dark primary color
D) None of the above
Question
According to the Android design guidelines, ________ dp is the recommended space between the edges of a device's touchable screen area and the app's content; however, many apps (such as games) use the full screen.

A) 1.6
B) 16
C) 160
D) 16.6
Question
Which of the following statements is false?

A) You must create methods onCreateOptionsMenu and onOptionsItem-Selected when you use Android Studio’s Blank Activity template.
B) Activity’s Resources object (returned by inherited method getResources-) can obtain a Configuration object (returned by method getConfiguration) that represents the device’s current configuration.
C) Inherited Activity method getMenuInflater returns a MenuInflater on which you can call inflate with two arguments—the resource ID of the menu resource that populates the menu and the Menu object in which the menu items will be placed.
D) Returning true from onCreateOptionsMenu indicates that the menu should be displayed.
Question
Which of the following is false?

A) Each Activity in an app must be declared in AndroidManifest.xml; other-wise, Android will not know that the Activity- exists and will not be able to launch it.
B) By default each Activity you create uses the "standard" launch mode. In this mode, when Android receives an Intent to launch the Activity, Android creates a new instance of that Activity
C) With MainActivity’s launchMode set to "singleTop", when the user touches the up button Android brings the existing MainActivity to the fore-ground, rather than creating a new MainActivity object.
D) Each of the above is true.
Question
Which of the following statements is false?

A) You can set an AlertDialog's title (which appears above the dialog's message) with AlertDialog.Builder method setTitle.
B) According to the Android design guidelines for dialogs, most dialogs need titles.
C) A dialog should display a title for "a high-risk operation involving potential loss of data, connectivity, extra charges, and so on."
D) Dialogs that display lists of options use the title to specify the dialog's purpose.
Question
Which of the following is false?

A) Animator method createCircularReveal creates a circular reveal animation.
B) Animator method setDuration specifies the animation's duration in milliseconds.
C) Animator method start begins executing the animation.
D) Animator method addListener registers a listener for various animation events, such as when the animation ends.
Question
Implement interface ________ to respond to Button events. The method receives the clicked Button as a parameter.

A) OnTouchListener
B) OnButtonClickListener
C) OnButtonTouchListener
D) OnClickListener
Question
As the user interacts with the preferences GUI, the preferences are automatically stored into a ________ file on the device. If the file does not exist, it will be created; otherwise, it will be updated.

A) Preferences
B) SharedPreferences
C) Settings
D) Configuration
Question
Which of the following is true?

A) Log static method error is used to log error messages.
B) Log static method e is used to log error messages.
C) Log static method exception is used to log error messages.
D) None of the above.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/66
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 4: Flag Quiz App
1
In what thread does a Handler's Runnable execute?

A) the GUI thread
B) the thread that created the Handler
C) a new thread that the Handler creates
D) None of the above
B
2
You can provide String resources for different languages and regions. Android uses resource folders with ________ to choose the appropriate images, based on a device’s pixel density, and the correct language strings, based on a device’s locale and region settings.

A) qualified names
B) disqualified names
C) unqualified names
D) None of the above.
qualified names
3
An object of class ________ contains public instance variable orientation containing either ORIENTATION_PORTRAIT or ORIENTATION_LANDSCAPE for the device's current orientation.

A) Settings
B) Configuration
C) Orientation
D) None of the above
B
4
Method onCreateView is called after onCreate to build and return a View con-taining the Fragment’s GUI. This method receives a(n) ________, which you’ll use to programmatically inflate a Fragment’s GUI from the components speci-fied in a predefined XML layout.

A) Inflater
B) GUICreator
C) GUIInflater
D) LayoutInflater
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
5
When the user selects a menu item, Activity method ________ responds to the selection.

A) onItemSelected
B) onOptionsItemSelected
C) onOptionSelected
D) onMenuItemSelected
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
6
Resource folder names that begin with anim contain XML files that define ________, which can change an object's transparency, size, position and rotation over time.

A) property
B) tweened
C) view
D) drawable
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
7
Which of the following statements is false?

A) A Fragment typically represents a reusable portion of an Activity’s user in-terface, but may also represent reusable program logic.
B) Like an Activity, each Fragment has its own layout that’s typically defined as an XML layout resource file (GUIs also can be created dynamically).
C) You can create an XML file describing the user preferences, then class PreferenceFragment can use that file to build an appropriate preferences GUI.
D) Fragments can be hosted by an Activity or they can execute independently
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
8
You specify the number of times an animation should repeat with Animation method ________.

A) setRepetitions
B) repetitions
C) setRepeatCount
D) repeatCount
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
9
In Java, a property is typically implemented in a class as a(n) ________.

A) static method
B) instance variable with both set and get accessors
C) non-static method
D) enumeration
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
10
Which of the following statements is false?

A) You can use a color state list to define separate colors for when Buttons are enabled or disabled.
B) Resource folder names that begin with raw contain resource files (such as audio clips) that are read into an app as streams of bytes. You use such resources to play sounds.
C) Resource folder names that begin with xml contain XML files that do not fit into the other resource categories-often XML data files used by the app.
D) All of the above are true.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
11
Handler- method ________ receives as arguments a Runnable to execute and a delay in milliseconds. After the delay has passed, the Handler’s Runnable exe-cutes in the same thread that created the Handler.

A) executeDelayed
B) runDelayed
C) handleDelayed
D) postDelayed
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
12
You can use the ViewAnimationUtils class to create a circular reveal Animator object by calling the createCircularReveal method. The animation appears as a --------________ circular window that displays part of a UI element.

A) rotating
B) shrinking
C) expanding
D) shrinking or expanding
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
13
You override Activity method ________ and use the method's Menu argument to add the menu items-either programmatically or by inflating an XML document that describes the menu items.

A) on-Create-Menu
B) on-Create-OptionsMenu
C) on-OptionsMenuOpened
D) on-MenuOpened
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
14
You must interact with a ________ dialog to dismiss it.

A) error
B) non-modal
C) modal
D) information
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
15
You could define a ________ for a Button's background color that specifies different colors for the Button's pressed, unpressed, enabled and disabled states.

A) color state list
B) color list
C) color group
D) color state group
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
16
Files in the assets subfolders are accessed via an ________, which can provide a list of all of the file names in a specified subfolder and can be used to access each asset.

A) FolderManager
B) Organizer
C) AssetOrganizer
D) AssetManager
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
17
________ are often used to display minor error messages or informational messages that disappear after a short period of time.

A) Tweets
B) Tooltips
C) Toasts
D) None of the above
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
18
Resource folder names that begin with ________ contain XML files that define property animations, which change the value of an object’s property over time.

A) animator
B) anim
C) animation
D) None of the above.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
19
Which of the following statements is false?

A) A PreferenceFragment uses Preference objects to manage app settings and stores those settings in a file via a SharedPreferences object.
B) A ListPreference creates checkboxes in which only one can be selected.
C) A MultiSelectListPreference creates a GUI containing checkboxes, any number of which can be selected.
D) To modify a SharedPreferences file’s contents, you’ll use a SharedPref-erences.Editor object.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
20
A FragmentManager can use ________ to dynamically add, remove and transition between Fragments.

A) Transactions
B) FragmentTransactions
C) FragmentTransitions
D) Transitions
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
21
If multiple activities can handle the action and data passed to startActivity, the system will ________.

A) display a dialog in which the user can select the activity to use
B) choose the first matching Activity
C) select a random Activity
D) None of the above
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
22
An Activity is launched by using a(n) ________ that indicates an action to be performed and the data on which to perform that action.

A) Action
B) IntendedAction
C) Launcher
D) Intent
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
23
Which of the next three statements is false?

A) When exceptions occur or when you want to track important aspects of your code’s execution, you can log messages for debugging purposes with Android’s built-in logging mechanism.
B) Android provides class Log (package android.util) with several static methods that represent messages of varying detail.
C) Logged messages can be viewed in the bottom of the Android Device Moni-tor’s LogCat tab or with the Android logcat tool.
D) Each of the above statements is true.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
24
If the system cannot find an activity to handle an Intent’s action, then method startActivity throws an Activity-NotFound-Exception. You can prevent this exception from happening by first using Intent method ________ to de-termine whether there is an Activity to handle the Intent.

A) findActivity
B) findActivityForIntent
C) resolveActivity
D) resolveActivityForIntent
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
25
When a color state list resource is provided for a Button color (either fore-ground or background), the appropriate color from the list of colors is selected, based on the Button’s ________.

A) relative horizontal position
B) importance
C) proximity to other GUI elements
D) state
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
26
Select File > New > Vector Asset to display the ________—this tool enables you to add to your project any of Google’s recommended material design icons. Each icon is defined as a scalable vector graphic that smoothly scales to any size.

A) Vector Image Studio
B) Vector Asset Studio
C) Asset Studio
D) Image Studio
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
27
A(n) ________ is a collection of animations that make up a larger animation.

A) animation list
B) animation set
C) animation map
D) None of the above
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
28
Which of the following three statements is false?

A) The Blank Activity template is a backward-compatible app template (for An-droid 2.1 and higher) that uses features of the Android Design Support Library.
B) The Blank Activity template must be used with a Fragment.
C) When you choose to use the Fragment option, the IDE creates layouts named activity_main.xml, content_main.xml and fragment_main.xml.
D) Each of the above statements are false
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
29
As with any other resource, color resources should be defined in XML so you can easily change colors without modifying your app's Java source code and so you can use Android's ________ capabilities to provide colors resources for various scenarios (different locales, night and day colors, and so on).

A) color-choosing
B) value-choosing
C) locale-choosing
D) resource-choosing
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
30
Which of the following three statements is false?

A) You must create the AndroidManifest.xml file when you create an app.
B) All activities in an Android app must be listed in the app’s manifest file.
C) When you add an activity to a project, the IDE will also add it to the mani-fest file.
D) All of the above statements are false.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
31
You can force a menu item to display on the app bar, in which case it's known as a(n) ________-by default, this is displayed as the menu item's icon (if there is one).

A) task
B) button
C) action
D) None of the above
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
32
The Android design guidelines indicate that text displayed in your GUI should be brief, simple and friendly with the important words ________.

A) centered
B) last
C) in italics
D) first
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
33
When you choose the Blank Activity template's Fragment option, this file contains only a ________ element that displays the MainActivityFragment's GUI defined in fragment_main.xml.

A)
B)
C)
D) None of the above
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
34
By convention array resources are normally defined in arrays.xml, colors in colors.xml, Strings in strings.xml and numeric values in ________.

A) numbers.xml
B) numeric.xml
C) digits.xml
D) values.xml
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
35
Which of the following statements is true?

A) The default activity_main.xml layout embeds (via an element in the XML) the GUI defined in content_main.xml.
B) The default activity_main.xml layout also contains a FloatingAc-tionButton—a round image button from the Android Design Support Library that has a higher elevation than the GUI’s other components, so it “floats” over the GUI.
C) Each app based on the Blank Activity template includes a FloatingAc-tionButton (which typically emphasizes an important action that the user can perform by touching the button) and other material design features.
D) All of the above statements are true.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
36
If the Java compiler can infer a generic object's type from the context, you can replace with <> when creating the object. In this context, <> is referred to as the ________ operator.

A) type
B) less than-greater than
C) inference
D) diamond
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
37
Each Activity declared in the AndroidManifest.xml file can specify ________ indicating actions the Activity is capable of handling.

A) intent extractors
B) activity filters
C) intent filters
D) None of the above
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
38
Which of the following statements about a standard AlertDialog is false?

A) Its negative action button cancels the dialog’s specified action, often labeled with CANCEL- or NO. This is the leftmost button when there are multiple but-tons in the dialog.
B) Its positive action button accepts the dialog’s specified action, often labeled with OK or YES. This is the rightmost button when there are multiple buttons in the dialog.
C) Its neutral action button indicates that the user does not want to cancel or accept the action specified by the dialog. For example, an app that asks the user to register to gain access to additional features might provide a REMIND ME LATER neutral button.
D) Each of the above statements is true.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
39
You can use Collections method ________ to randomize the order of the elements in an ArrayList.

A) reorder
B) shuffle
C) srand
D) randomize
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
40
Android uses a technique known as ________ to communicate information between activities within one app or activities in separate apps.

A) intent messaging
B) intent dispatching
C) intent broadcasting
D) None of the above
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
41
Setting the ImageView's adjustViewBounds property to true indicates that the ImageView maintains its image's ________.

A) width
B) height
C) resolution
D) aspect ratio
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
42
A ________ animation moves a View within its parent.

A) alpha
B) scale
C) rotate
D) translate
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
43
By default, animations in an animation set are applied simultaneously (i.e., 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.

A) android:startTime
B) android:offset
C) android:sequence
D) android:startOffset
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
44
The ________ attribute specifies how long the animation lasts in milliseconds.

A) android:duration
B) android:length
C) android:playbackTime
D) android:time
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
45
By default, the IDE set the layout’s Padding Left and Padding Right properties to a predefined dimension resource named @dimen/activity_horizontal_margin—located in the ________ file of the project’s res/values folder.

A) dimensions.xml
B) values.xml
C) strings.xml
D) dimens.xml
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
46
Method inflate returns a reference to a ________ that contains the inflated GUI.

A) Layout
B) Inflator
C) View
D) RelativeLayout
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
47
It’s considered a best practice in Android to ensure that every GUI component can be used with TalkBack. For components that don’t have descriptive text, such as Image-Views, set the component’s ________ property.

A) description
B) contentDescription
C) talkback
D) talkbackDescription
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
48
IOExceptions are ________ exceptions (so you must catch or declare the exception).

A) required
B) important
C) special
D) checked
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
49
Which of the following is not a tweened animation that you can include in an animation set?

A) alpha
B) scale
C) rotate
D) flip
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
50
When you install and launch an app for the first time, calling Prefer-enceManager method setDefaultValues sets the app’s default prefer-ences—this creates and initializes the app’s ________ file using the default values that you specified in preferences.xml.

A) Settings
B) Preferences
C) SharedPreferences
D) SharedSettings
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
51
Setting the layout:height property to 0dp will let a View's height be determined by the ________ property.

A) layout:weight
B) layout:width
C) layout:automatic
D) None of the above
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
52
You can use a(n) ________ object to delay the performance of an action.

A) DelayedAction
B) ActionHandler
C) TaskHandler
D) Handler
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
53
Toast method ________ receives as arguments the Context on which the Toast is displayed, the message to display and the duration for which the Toast will be displayed. Toast method show displays the Toast.

A) makeToast
B) buildToast
C) makeText
D) buildText
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
54
Which of the following statements is false?

A) When the app first executes, onCreate is called after onStart.
B) When the app is running in portrait orientation and the user opens the Set-tings-Activity, the MainActivity is stopped while the SettingsActivity is displayed. When the user returns to the MainActivity, onStart is called again.
C) To get a reference to the MainActivityFragment so we can call its methods, use inherited AppCompatActivity method getSupportFragmentManager to get the FragmentManager, then call its findFragmentById method.
D) Each of the above statements is true.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
55
It's often easiest to select a particular GUI component in ________.

A) the design area
B) the Component Tree window
C) XML
D) None of the above
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
56
Method ________ is called when a menu item is selected.

A) onOptionSelected
B) onMenuItemSelected
C) onItemSelected
D) onOptionsItemSelected
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
57
Method getConfiguration returns a Configuration object (package android.content.res) containing public instance variable ________, which specifies the device's screen-size category.

A) screenSize
B) size
C) layout
D) screenLayout
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
58
Setting a Button's style property to @android:style/Widget.Material.Button.Colored causes the Button to take on a colored appearance, based on the colors of the app's theme. The Buttons' color will be the theme's ________.

A) accent color
B) primary color
C) dark primary color
D) None of the above
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
59
According to the Android design guidelines, ________ dp is the recommended space between the edges of a device's touchable screen area and the app's content; however, many apps (such as games) use the full screen.

A) 1.6
B) 16
C) 160
D) 16.6
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
60
Which of the following statements is false?

A) You must create methods onCreateOptionsMenu and onOptionsItem-Selected when you use Android Studio’s Blank Activity template.
B) Activity’s Resources object (returned by inherited method getResources-) can obtain a Configuration object (returned by method getConfiguration) that represents the device’s current configuration.
C) Inherited Activity method getMenuInflater returns a MenuInflater on which you can call inflate with two arguments—the resource ID of the menu resource that populates the menu and the Menu object in which the menu items will be placed.
D) Returning true from onCreateOptionsMenu indicates that the menu should be displayed.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
61
Which of the following is false?

A) Each Activity in an app must be declared in AndroidManifest.xml; other-wise, Android will not know that the Activity- exists and will not be able to launch it.
B) By default each Activity you create uses the "standard" launch mode. In this mode, when Android receives an Intent to launch the Activity, Android creates a new instance of that Activity
C) With MainActivity’s launchMode set to "singleTop", when the user touches the up button Android brings the existing MainActivity to the fore-ground, rather than creating a new MainActivity object.
D) Each of the above is true.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
62
Which of the following statements is false?

A) You can set an AlertDialog's title (which appears above the dialog's message) with AlertDialog.Builder method setTitle.
B) According to the Android design guidelines for dialogs, most dialogs need titles.
C) A dialog should display a title for "a high-risk operation involving potential loss of data, connectivity, extra charges, and so on."
D) Dialogs that display lists of options use the title to specify the dialog's purpose.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
63
Which of the following is false?

A) Animator method createCircularReveal creates a circular reveal animation.
B) Animator method setDuration specifies the animation's duration in milliseconds.
C) Animator method start begins executing the animation.
D) Animator method addListener registers a listener for various animation events, such as when the animation ends.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
64
Implement interface ________ to respond to Button events. The method receives the clicked Button as a parameter.

A) OnTouchListener
B) OnButtonClickListener
C) OnButtonTouchListener
D) OnClickListener
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
65
As the user interacts with the preferences GUI, the preferences are automatically stored into a ________ file on the device. If the file does not exist, it will be created; otherwise, it will be updated.

A) Preferences
B) SharedPreferences
C) Settings
D) Configuration
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
66
Which of the following is true?

A) Log static method error is used to log error messages.
B) Log static method e is used to log error messages.
C) Log static method exception is used to log error messages.
D) None of the above.
Unlock Deck
Unlock for access to all 66 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 66 flashcards in this deck.