Deck 5: Doodlz App
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/34
Play
Full screen (f)
Deck 5: Doodlz App
1
A ________ is used to register listeners for accelerometer events.
A) AccelerometerManager
B) ListenerManager
C) SensorProcessor
D) SensorManager
A) AccelerometerManager
B) ListenerManager
C) SensorProcessor
D) SensorManager
SensorManager
2
Android Studio uses the ________ build system to compile your code into an APK file-the installable app. This system also handles project dependencies, such as including in the build process any libraries used by the app.
A) Buck
B) Maven
C) Bazel
D) Gradle
A) Buck
B) Maven
C) Bazel
D) Gradle
D
3
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.
A) Printer
B) PrinterUI
C) PrintHelper
D) None of the above
A) Printer
B) PrinterUI
C) PrintHelper
D) None of the above
C
4
Google's material design specification indicates that a Button's text should ________.
A) use all lowercase letters
B) use all capital letters (e.g., CANCEL or SET COLOR) for languages that support them
C) use initial uppercase letters
D) None of the above
A) use all lowercase letters
B) use all capital letters (e.g., CANCEL or SET COLOR) for languages that support them
C) use initial uppercase letters
D) None of the above
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
5
Most devices have a(n) ________ for detecting device movement.
A) accelerator
B) speed sensor
C) accelerometer
D) None of the above.
A) accelerator
B) speed sensor
C) accelerometer
D) None of the above.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
6
Android requires the user’s permission to allow an app to save files. In Android 6.0, the app ________.
A) prompts the user at installation time with a complete list of permissions the app requires.
B) prompts the user at installation time and execution time with a complete list of permissions the app requires.
C) requests each permission individually at execution time, only when the per-mission is required to perform a given task for the first time.
D) None of the above.
A) prompts the user at installation time with a complete list of permissions the app requires.
B) prompts the user at installation time and execution time with a complete list of permissions the app requires.
C) requests each permission individually at execution time, only when the per-mission is required to perform a given task for the first time.
D) None of the above.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
7
A Fragment can place items in the app’s app bar and options menu. To do so, the Fragment must call its ________ method with the argument true.
A) setHasOptionsMenu
B) setOptionsMenu
C) setMenu
D) setHasMenu
A) setHasOptionsMenu
B) setOptionsMenu
C) setMenu
D) setHasMenu
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
8
In addition to standard touch-event handling, Android 6.0 provides enhanced support for using a(n) ________ stylus with apps, including access to pressure data and which stylus button the user presses.
A) Wi-Fi
B) Bluetooth
C) NFC
D) Ethernet
A) Wi-Fi
B) Bluetooth
C) NFC
D) Ethernet
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
9
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.
A) Draw
B) Characteristics
C) Settings
D) Paint
A) Draw
B) Characteristics
C) Settings
D) Paint
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
10
Accelerometer information is delivered to the app as ________ values.
A) double
B) String
C) float
D) int
A) double
B) String
C) float
D) int
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
11
You override SensorEventListener method ________ to process accelerometer events. This method should handle sensor events quickly or to copy the event data because the array of sensor values is reused for each sensor event.
A) sensorChanged
B) onSensorEvent
C) onSensorChanged
D) None of the above
A) sensorChanged
B) onSensorEvent
C) onSensorChanged
D) None of the above
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
12
We use each menu item’s ________ property to specify that the menu item should be displayed on the app bar if there is room.
A) showAsAction
B) showOnActionBar
C) showIfRoom
D) None of the above
A) showAsAction
B) showOnActionBar
C) showIfRoom
D) None of the above
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
13
Which of the following statements is false?
A) A Fragment’s lifecycle is tied to that of its parent Activity.
B) There are six Activity lifecycle methods that have corresponding Fragment lifecycle methods—onCreate, onStart, onResume, onPause, onStop and onDestroy.
C) When the system calls life cycle methods on an Activity, it will also call the corresponding methods (and potentially other Fragment lifecycle methods) on all of the Activity’s attached Fragments.
D) An Activity’s onResume method is called when a Fragment is on the screen and ready for the user to interact with it.
A) A Fragment’s lifecycle is tied to that of its parent Activity.
B) There are six Activity lifecycle methods that have corresponding Fragment lifecycle methods—onCreate, onStart, onResume, onPause, onStop and onDestroy.
C) When the system calls life cycle methods on an Activity, it will also call the corresponding methods (and potentially other Fragment lifecycle methods) on all of the Activity’s attached Fragments.
D) An Activity’s onResume method is called when a Fragment is on the screen and ready for the user to interact with it.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
14
A ________ object (package android-.graphics) represents line segments and curves.
A) Segment
B) Line
C) Path
D) Curve
A) Segment
B) Line
C) Path
D) Curve
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
15
Which of the following statements is false?
A) When an Activity hosts Fragments and the Activity is resumed, all of its Fragments' onResume methods are called.
B) 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.
C) When an Activity hosts Fragments and the Activity is paused, all of its Fragments' onPause methods are called.
D) When an app is paused, it should ensure that listeners for sensor events are still active.
A) When an Activity hosts Fragments and the Activity is resumed, all of its Fragments' onResume methods are called.
B) 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.
C) When an Activity hosts Fragments and the Activity is paused, all of its Fragments' onPause methods are called.
D) When an app is paused, it should ensure that listeners for sensor events are still active.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
16
You use class SensorManager's ________ method to stop listening for accelerometer events.
A) reset
B) unregisterListener
C) stopListening
D) None of the above
A) reset
B) unregisterListener
C) stopListening
D) None of the above
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
17
In addition to using Android 6.0’s new permissions model in which the app asks the user to grant permissions dynamically, each app also must specify any permissions it uses in ________.
A) class MainActivity
B) strings.xml
C) permissions.xml
D) AndroidManifest.xml
A) class MainActivity
B) strings.xml
C) permissions.xml
D) AndroidManifest.xml
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
18
A(n) ________ (package android-.content) enables the app to read data from and store data on a device.
A) Content-Resolver
B) Resolver
C) ContentAccessor
D) None of the above
A) Content-Resolver
B) Resolver
C) ContentAccessor
D) None of the above
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
19
Colors are defined using the ARGB color scheme in which the ________ (i.e., transparency), red, green and blue components, respectively, are specified by integers in the range 0–255.
A) transparency
B) translucency
C) alpha
D) None of the above.
A) transparency
B) translucency
C) alpha
D) None of the above.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
20
Which of the following statements is false?
A) Android requires the permission an-droid.permission.WRITE_EXTERNAL_PERMISSION before an app can write to external storage.
B) Before Android 6.0, a user was required at start time to grant in advance all permissions that an app would ever need—this caused many people not to in-stall certain apps.
C) With the new permissions model, the app is installed without asking for any permissions. Instead, the user is asked to grant a permission only the first time the corresponding feature is used.
D) Once the user grants a permission, the app has that permission until the app is reinstalled or the user changes the app’s permissions via the Android Settings app.
A) Android requires the permission an-droid.permission.WRITE_EXTERNAL_PERMISSION before an app can write to external storage.
B) Before Android 6.0, a user was required at start time to grant in advance all permissions that an app would ever need—this caused many people not to in-stall certain apps.
C) With the new permissions model, the app is installed without asking for any permissions. Instead, the user is asked to grant a permission only the first time the corresponding feature is used.
D) Once the user grants a permission, the app has that permission until the app is reinstalled or the user changes the app’s permissions via the Android Settings app.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
21
Call inherited View method ________ to indicate that the View needs to be redrawn.
A) redraw
B) repaint
C) update
D) invalidate
A) redraw
B) repaint
C) update
D) invalidate
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
22
If a Path already exists for the given ID, we call Path's ________ method to clear any existing points so we can reuse the Path for a new stroke.
A) erase
B) clear
C) reset
D) reuse
A) erase
B) clear
C) reset
D) reuse
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
23
Which of the following statements is false?
A) The system MotionEvent passed from onTouchEvent contains touch infor-mation for multiple moves on the screen if they occur at the same time.
B) MotionEvent method getPointerCount returns the number of touches the Motion-Event describes.
C) MotionEvent-’s getX and getY methods to get the last coordinates for a drag event.
D) MotionEvents are not generated when the user holds a finger motionless on the screen.
A) The system MotionEvent passed from onTouchEvent contains touch infor-mation for multiple moves on the screen if they occur at the same time.
B) MotionEvent method getPointerCount returns the number of touches the Motion-Event describes.
C) MotionEvent-’s getX and getY methods to get the last coordinates for a drag event.
D) MotionEvents are not generated when the user holds a finger motionless on the screen.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
24
Method ________ is called when the position of a SeekBar's thumb changes.
A) onSeekBarChanged
B) onThumbPositionChanged
C) onValueChanged
D) onProgressChanged
A) onSeekBarChanged
B) onThumbPositionChanged
C) onValueChanged
D) onProgressChanged
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
25
PrintHelper.SCALE_MODE_FIT indicates that ________.
A) the PrintHelper dialog should be scalled to fit on the screen
B) the image should be scaled to fit in the PrintHelper dialog
C) the image should fit within the printable area of the paper
D) None of the above
A) the PrintHelper dialog should be scalled to fit on the screen
B) the image should be scaled to fit in the PrintHelper dialog
C) the image should fit within the printable area of the paper
D) None of the above
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
26
Path's ________ method clears the Path's data.
A) restart
B) reset
C) reinitialize
D) clear
A) restart
B) reset
C) reinitialize
D) clear
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
27
In apps that support both portrait and landscape orientations, onSizeChanged is called each time the user rotates the device. This could result in a new Bitmap each time the method is called. When replacing a Bitmap, you should call the prior Bitmap’s ________ method to release its resources.
A) reuse
B) recycle-
C) release
D) discard
A) reuse
B) recycle-
C) release
D) discard
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
28
Which of the following statements is false?
A) When an app's Fragments interact with one another directly, we call this a loosely coupled approach.
B) Generally, a parent Activity manages an app's Fragment interactions.
C) To pass data to a Fragment, the Activity provides a Bundle of arguments.
D) Each Fragment class typically provides an interface of callback methods that its Activity implements. When the Fragment needs to notify its parent Activity of a state change, the Fragment calls the appropriate callback method.
A) When an app's Fragments interact with one another directly, we call this a loosely coupled approach.
B) Generally, a parent Activity manages an app's Fragment interactions.
C) To pass data to a Fragment, the Activity provides a Bundle of arguments.
D) Each Fragment class typically provides an interface of callback methods that its Activity implements. When the Fragment needs to notify its parent Activity of a state change, the Fragment calls the appropriate callback method.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
29
When a View needs to be redrawn, its ________ method is called.
A) onUpdateRequred
B) onDraw
C) onPaint
D) None of the above
A) onUpdateRequred
B) onDraw
C) onPaint
D) None of the above
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
30
When a Fragment is removed from a parent Activity, method ________ is called.
A) onDestruct
B) onRemove
C) onDisconnect
D) onDetach
A) onDestruct
B) onRemove
C) onDisconnect
D) onDetach
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
31
Passing true to Paint's ________ method enables smoothing the edges of the lines.
A) setSmoothing
B) setHigherResolution
C) setAntiAlias
D) None of the above
A) setSmoothing
B) setHigherResolution
C) setAntiAlias
D) None of the above
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
32
When the user selects a Fragment's menu item, Fragment method ________ responds to the selection.
A) onItemSelected
B) onMenuItemSelected
C) onOptionsItemSelected
D) onMenuSelected
A) onItemSelected
B) onMenuItemSelected
C) onOptionsItemSelected
D) onMenuSelected
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
33
If an app does not have a needed permission (such as android.permission.WRITE_EXTERNAL_STORAGE), use the built-in ________ method to determine whether an explanation of why the app needs this permission should be displayed.
A) shouldShowRationale
B) shouldShowPermissionRationale
C) shouldShowRequestRationale
D) shouldShowRequestPermissionRationale
A) shouldShowRationale
B) shouldShowPermissionRationale
C) shouldShowRequestRationale
D) shouldShowRequestPermissionRationale
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
34
SeekBar's ________ method positions the SeekBar's thumb.
A) setPosition
B) setProgress
C) setValue
D) setThumb
A) setPosition
B) setProgress
C) setValue
D) setThumb
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck