1/346
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
A layout defines the ______ for a user interface in your app, such as in an activity.
structure
Android UI elements are built using a hierarchy of ______ and ______ objects.
"View ViewGroup"
The object that draws something the user can see and interact with is called a ______.
View
The invisible container that defines the layout structure for View and other ViewGroup objects is called a ______.
ViewGroup
Each layout file must contain exactly one ______ element, which must be a View or ViewGroup object.
root
After defining the root element, you can add additional layout objects or widgets as ______ elements to build a View hierarchy.
child
View objects are often called ______ and include subclasses such as Button or TextView.
widgets
ViewGroup objects are often called ______ and include types such as LinearLayout or ConstraintLayout.
layouts
One way to define View and ViewGroup elements is to declare UI elements in ______.
XML
Another way to define View and ViewGroup elements is to instantiate layout elements at ______.
runtime
The file location for a layout resource is ______/layout/filename.xml.
res
In Java, you reference a layout resource using ______.layout.filename.
R
What is the syntax to reference a layout resource in XML? Use @[package:]______ /filename.
layout
A
View
Name three common ViewGroup subclasses mentioned in the reviewer.
LinearLayout, RelativeLayout, FrameLayout
Some ViewGroups are implementations of the ______ class and determine their children only from an Adapter.
AdapterView
Which attribute gives a View or ViewGroup a unique resource name?
android:id
Which attributes specify the height and width of a View or ViewGroup?
android:layout_height and android:layout_width
To create a new resource ID for a View, use the syntax '@+id/______'.
name
The '+' symbol in '@+id/name' indicates that a new ______ will be created if it doesn't already exist.
resource ID
When referencing an Android resource ID from the framework, use the syntax android:id='@______/resource_id'.
id
Dimension attributes such as android:layout_height can be expressed using units like px, dp, sp, pt, in or ______.
mm
Custom View elements allow you to create your own View and ViewGroup classes and specify supported ______ in the XML element.
attributes
In loading a view, you should define the view in the layout file and assign a unique ______.
ID
After defining a view in the layout file, create an instance and capture it from the layout typically in the ______ method.
onCreate()
Which layout arranges child View instances in either a horizontal or vertical direction based on the orientation property?
LinearLayout
The orientation of a LinearLayout is specified using the ______ attribute.
android:orientation
Which ViewGroup allows you to position child views relative to each other or the parent, eliminating nested view groups?
RelativeLayout
Using RelativeLayout helps keep the layout hierarchy ______, which improves performance.
flat
Which layout displays only a single view, stacking child views so the most recently added appears on top?
FrameLayout
FrameLayout acts as a ______ on the screen and holds a single child view.
placeholder
You can control the position of child views in a FrameLayout by using ______ attributes.
gravity
Which layout displays child elements in rows and columns similar to an HTML table?
TableLayout
In a TableLayout, the table will have as many columns as the row with the most ______.
cells
TableRow in Android TableLayout is analogous to which HTML tag?
Which layout is an extension of the View class that allows you to display static or remote web pages within an activity?
WebView
A WebView acts as an embedded browser but does NOT contain features of a normal browser such as the ______ or navigation controls.
address bar
Which ViewGroup displays a list of scrollable items in multiple rows with items automatically inserted using an adapter?
ListView
In a ListView, the ______ acts as an intermediate between the data source and the adapter view.
adapter
An adapter holds the data and iterates through items in the data set, generating views for each item in the ______.
list
Which ViewGroup displays items in a two‑dimensional scrollable grid with items inserted automatically using a list adapter?
GridView
Which control is used to display text to the user?
TextView
Which control is a predefined subclass of TextView that includes rich editing capabilities?
EditText
Which control is similar to EditText but shows a list of completion suggestions automatically while the user types?
AutoCompleteTextView
Which control provides a push‑button that can be pressed or clicked by the user to perform an action?
Button
Which control shows a button with an image instead of text and lets you specify the exact location of its children?
ImageButton
Which control is an on/off switch that can be toggled by the user and is used when presenting options that are not mutually exclusive?
CheckBox
Which control is an on/off button with a light indicator?
ToggleButton
Which control has two states (checked or unchecked) and is often grouped with others in a RadioGroup?
RadioButton
Which control is used to group together one or more RadioButtons?
RadioGroup
Which view provides visual feedback about ongoing tasks, such as when performing a task in the background?
ProgressBar
Which control is a drop‑down list that allows users to select one value from a set?
Spinner
Which view enables users to select a time of day, either in 24‑hour or AM/PM mode?
TimePicker
Which view enables users to select a date?
DatePicker
In Android, an event listener is an interface in the View class that contains a single ______ method.
callback
When a registered View is triggered by user interaction, the Android framework calls the methods in the event ______.
listener
When an event occurs and an event listener has been registered, the listener calls the event ______ method that handles the event.
handler
An Android ______ is an abstract description of an operation to be performed and can start activities, broadcast messages, or communicate with services.
Intent
Which method would you use to launch an Activity using an Intent?
startActivity
Which method sends an Intent to interested BroadcastReceiver components?
broadcastIntent
Which method can you use to communicate with a background Service using an Intent?
startService(Intent)
The Intent object is a passive data structure holding an ______ description of an operation to be performed.
abstract
Explicit intents are used to connect components within the same application, such as connecting one ______ to another.
activity
Implicit intents do not name a target; the ______ field is left blank and they are used to activate components in other applications.
component name
To add data into an Intent, you use the methods putExtra() or ______().
putExtras
The key‑value pairs stored in an Intent are known as ______.
extras
To retrieve extra data attached to an Intent in the target activity, call ______ on the Intent.
getExtras()
A ______ is a mapping from String keys to parcelable values that can be passed through an Intent.
Bundle
Which method do you use on the target activity to get the attached Bundle from an Intent?
getExtras()
To pass a Java object like an ArrayList or HashMap through a Bundle, the object must be ______.
serialized
To put a serializable object into a Bundle, use ______('KEY', OBJECT).
putSerializable
To retrieve a serialized object from a Bundle in the target activity, call ______('KEY', DEFAULT) and cast it to the appropriate type.
getSerializable
A ______ provides simple feedback about an operation in a small popup that disappears after a timeout.
Toast
When you create a toast, you call makeText() with three parameters: the application ______, the text message and the ______.
"Context duration"
After creating a Toast object, you display it by calling ______.
show()
A standard toast appears near the bottom of the screen, centered horizontally, but you can change its position using ______(int, int, int).
setGravity
In Android, a ______ is a message you can display to the user outside of your app's normal UI and it first appears as an icon in the notification area.
notification
To see the details of a notification, the user opens the ______.
notification drawer
Beginning with Android 5.0, notifications can appear in a floating window called a ______ notification.
heads-up
Heads‑up notifications are normally used for ______ notifications that the user should know about immediately.
important
Heads‑up notifications appear only if the device is ______.
unlocked
Starting with Android 5.0, notifications can appear on the ______ screen.
lock
You can control the level of detail and visibility of your app's notifications on the ______ screen.
lock
On devices running Android 8.0 or higher, app icons indicate new notifications with a colored ______ (notification dot).
badge
On supported launchers, users can ______ an app icon to see its notifications and act on them.
long-press
The design of a notification is determined by system ______; your app defines the content for each portion.
templates
In Android Studio projects, you should verify that your module-level build.gradle file includes the dependency for ______.
NotificationCompat
To set a notification's content and channel, you use a ______ object.
NotificationCompat.Builder
Which method on NotificationCompat.Builder sets the small icon for a notification?
setSmallIcon()
Which method on NotificationCompat.Builder sets the notification's title?
setContentTitle()
Which method on NotificationCompat.Builder sets the notification's body text?
setContentText()
Which method sets the notification's priority for Android 7.1 and lower?
setPriority()
The NotificationCompat.Builder constructor requires a ______ ID for compatibility with Android 8.0 and higher.
channel
By default, notification text is truncated to fit one line; to enable a longer notification you can add a style template with ______().
setStyle
On Android 8.0 and higher, before delivering a notification you must register your app's notification ______ with the system.
channel
The NotificationChannel constructor requires an ______ parameter from NotificationManager.
importance
On Android 7.1 and lower, you set the notification's ______ using setPriority().
priority
Although you must set notification importance and priority, the system may change it and the ______ can redefine it.
user
Every notification should respond to a tap by specifying a content intent with a ______ and passing it to setContentIntent().
PendingIntent
If an activity exists exclusively for responses to a notification, it should start a ______ task instead of being added to the existing back stack.
new