COP4656 Midterm - Test

Ace your homework & exams now with Quizwiz!

The method is called whenever the text in the amount-EditText is modified. a. onNewValue b. onEditTextChanged c. watchedTextChanged d. onTextChanged

d

To respond to events when the user changes the text in an EditText, you'll use an anonymous inner class to implement the interface (from package android-.text). a. EditTextListener b. TextListener c. EditTextWatcher d. TextWatcher

d

You must interact with a ________ dialog to dismiss it. a. error b. non-modal c. modal d. information

c

A class houses the ________ that perform the class's tasks. a. methods. b. functions. c. procedures. d. None of the above.

a

Android apps have four types of executable components—activities, services, content providers and . a. broadcast receivers b. broadcast transmitters c. broadcasters d. receivers

a

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

a

Java requires that you override every method in an that you implement. a. struct b. class c. interface d. enumeration

c

When your app is installed on a device, its icon and name appear with all other installed apps in the ________. a. finder b. explorer c. launcher d. None of the above.

c

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. <fragment_main> b. <fragment> c. <main_fragment> d. None of the above

b

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.

b

Which of the following satements is false? a. The style.xml resource file contains a style with the name "AppTheme" that's referenced from the app's AndroidManifest.xml file to specify the app's theme. b. A parent theme is similar to a subclass in Java—the new style inherits its parent theme's attributes and their default values. c. Just as in a Java subclass, a style can override parent theme attributes with values customized for specific apps. d. By default, Android Studio sets the parent theme to Theme.AppCompat.Light.DarkActionBar one of several predefined themes from the AppCompat library—apps that use this theme have a light background, except for the dark app bar at the top of the app

b

The manifest element's nested element specifies attributes of the a. activity b. application c. app d. None of the above.

b

When the user selects a menu item, Activity method ________ responds to the selection. a. onItemSelected b. onOptionsItemSelected c. onOptionSelected d. onMenuItemSelected

b

A ________ animation moves a View within its parent. a. alpha b. scale c. rotate d. translate

d

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

d

Which of the following statements about adding an ImageView to the GUI by dragging it from the Palette's Widgets section onto the canvas is false? a. When you drag a view onto the canvas, the layout editor displays orange guide lines, green guide lines and a tooltip. b. The orange guide lines show the bounds of each existing view in the layout. c. The green guide lines indicate where the new view will be placed with respect to the existing views—by default, new views are added at the top of a vertical LinearLayout, unless you position the mouse below the orange box that bounds the layout's bottommost view. d. The tooltip displays how the view will be configured if you drop it at the current position.

c

Which of the following statements is false? a. A GridLayout (package android.widget) arranges views into rows and columns, each indexed from 0 like the elements of an array. b. Each cell of a GridLayout can be empty or can hold one or more views, including layouts containing other views. c. A GridLayout row's height is determined by the row's tallest view--similarly, a column's width is defined by the column's widest view. d. A GridLayout's views can span multiple rows and/or columns.

c

Which of the following statements is false? a. Android Studio's layout editor enables you to build GUIs using drag-and-drop techniques. b. You can edit the GUI's XML directly. c. In portrait orientation the device's width is greater than its height. d. Android's Explore by Touch enables users to touch items on the screen and hear TalkBack speak the corresponding descriptive text.

c

Which of the following statements is false? a. Android devices have various screen sizes, resolutions and pixel densities (that is, dots per inch or DPI), so you typically provide images in various resolutions that the operating system chooses based on a device's pixel density. These are placed in drawable folders (in a project's res folder) that store images with different pixel densities. b. Android Studio displays only one drawable folder containing the app's drawable resources, even if your project contains resources for multiple densities. c. If Android cannot find an image in the drawable folder that most closely matches the device's pixel density, Android will display nothing for that image. d. Low-resolution images do not scale well. For images to render nicely, a high-pixel-density device needs higher-resolution images than a low-pixel-density device

c

Which of the following statements is false? a. For people with visual disabilities, Android's TalkBack can speak screen text or text that you provide (when designing your GUI or programmatically) to help the user understand the purpose of a view. b. Android also provides Explore by Touch, which enables the user to hear TalkBack speak what's on the screen where the user touches. c. Most standard Android views support accessibility. d. You enable TalkBack in the Settings app under Accessibility. From that page, you also can enable other Android accessibility features such as a larger default text size and the ability to use gestures that magnify areas of the screen.

c

Which of the following statements is false? a. For your convenience, Google provides many preconfigured devices that you can use to quickly create AVDs. b. You perform the swipe gesture on an AVD by placing the mouse over the AVD's "screen" and dragging up with the mouse. c. One problem with developing Android apps is that you'll need to purchase a broad range of devices on which to test your apps. d. All of the above are true.

c

Which of the following statements is false? a. The Android emulator is particularly useful if you do not have access to Android devices for testing. b. Although you can simulate orientation changes (to portrait or landscape mode), simulating particular accelerometer readings (the accelerometer allows the device to respond to up/down, left/right and forward/backward acceleration) requires features that are not built into the emulator. c. The Android emulator enables you to simulate the full range of Android gestures. d. You should certainly test your apps on a variety of Android devices before uploading them to Google Play.

c

Which of the following statements is false? a. The Minimum SDK is the minimum Android API level that's required to run your app. This allows your app to execute on devices supporting that API level and higher. b. Lower Minimum SDK values enable your app to run on more devices. c. Generally you should target the highest API level on which your app can run. d. You must disable newer features that are not available on older platforms when your app is installed on those platforms.

c

Which of the following statements is false? a. The package name normally begins with your company's or institution's Company Domain in reverse. This is followed by a dot (.) and the app's name in all lowercase letters with any spaces removed. b. By convention, package names use only lowercase letters. c. The IDE sets the package name using the text you enter for Company Name and Company Domain. d. By default, Android Studio places new project folders in the subfolder AndroidStudioProjects in your user account directory.

c

Which of the following statements is false? a. When a GUI is displayed in the layout editor, you can use the Properties window below the Component Tree to configure the selected view's properties. b. You also can edit a view's most commonly used properties by double clicking the view in the canvas. The layout editor then displays a small dialog in which you can set the view's id property and other properties that depend on the specific view: c. For a LinearLayout, you can set the orientation to specify whether the layout's children are arranged in horizontal or vertical orientation. d. For an ImageView, you can set the src (source) of the image to display.

c

Which of the following statements is false? a. When you need custom colors in your apps, Google's Material Design guidelines recommend using colors from the Material Design color palette. b. Colors are specified as RGB (red-green-blue) or ARGB (alpha-red-green-blue) values. c. An RGB value consists of integer values in the range 1-100 that define the amounts of red, green and blue in the color, respectively. d. Custom colors are defined in hexadecimal format, so the RGB components are values in the range 00 (the hexadecimal value for 0) to FF (the hexadecimal value for 255).

c

Which of the following statements is false? a. You can use a vertical LinearLayout to arrange an app's text and image with each occupying half the LinearLayout's vertical space. b. A LinearLayout also can arrange views horizontally. c. The default GUI created by Android Studio already contains an ImageView. d. You can use the layout editor's Palette of views to drag and drop an ImageView onto a GUI, then configure its properties.

c

With a ________ you can, for example, specify that one view should appear below another and be centered horizontally within this layout. a. LinearLayout b. CenteredLayout c. RelativeLayout d. None of the above.

c

With web services, you can create ________, which enable you to rapidly develop apps by quickly combining complementary web services, often from different organizations and possibly other forms of information feeds. a. smashups b. match ups. c. mashups. d. None of the above.

c

You may configure your AVD (or device) to display the keyboard for better contrast in your screen captures. a. black b. shaded c. dark d. ebony

c

________ is now Google's preferred Android IDE. It's based on the JetBrains IntelliJ IDEA Java IDE. a. Eclipse b. Visual Studio c. Android Studio. d. None of the above.

c

A LinearLayout can proportionally size its children based on their ________, which specify the view's relative size with respect to the layout's other views. a. layout:widths b. layout:heights c. layout:gravity d. layout:weights

d

A ________ is a group of related files, such as code files, resource files and images that make up an app. a. folder b. directory c. solution d. project

d

Android Studio allows you to build your GUI by dragging and dropping views—such as Text-Views, Image-Views and Buttons—onto the ________. a. GUI designer b. layout designer c. GUI editor d. layout editor

d

For an ImageView there is no text for TalkBack to speak unless you provide it. It's considered good practice in Android to ensure that every view can be used with TalkBack by providing text for the ________ property of any view that does not display text. a. talkBack b. description c. hint d. contentDescription

d

GUI programming in Java is ________ —in this book, you'll write apps that respond to various user-initiated events such as screen touches. a. user driven b. programmer driven c. IDE driven d. event driven.

d

If Android cannot find a localized version of a string resource, it uses the default version in the ________ file. a. res/values/defaults.xml b. res/values/english.xml c. res/values/values.xml d. res/values/strings.xml

d

To create the best solutions, you should follow a detailed analysis process for determining your project's ________ (i.e., defining what the system is supposed to do) and developing a design that satisfies them (i.e., deciding how the system should do it). a. prerequisites. b. preconditions. c. options. d. requirements.

d

What key Android Ice Cream Sandwich developer feature is described by the following? "Using the camera, compatible devices can determine the positioning of the user's eyes, nose and mouth. The camera also can track the user's eye movement, allowing you to create apps that change perspective, based on where the user is looking." a. Social API. b. Virtual camera operator. c. Accessibility API. d. Face detection.

d

When the layout editor is open in Design view, the ________ appears at the right side of the IDE. This window shows the layouts and views (GUI components) that comprise the GUI and their parent-child relationships—for example, a layout (the parent) might contain many nested views (the children), including other layouts. a. Project window b. Properties window c. Palette d. Component Tree

d

When you open a layout XML file, the layout's design appears in the layout editor and the layout's views and their hierarchical relationships appear in the ________ window. a. Outline b. Tree c. Layout Editor d. Component Tree

d

Which of the first three statements about uploading apps to Google Play is false? a. You can upload multiple versions of the app for various device- sizes and screen resolutions. b. All images in the mipmap folders are uploaded with every version of your app. c. You can remove extra drawable folders for specific pixel densities from a given app version to minimize the total installation size for a particular device. d. All of the above are true.

d

Which of the first three statements below is false? a. Android provides accessibility features to help people with certain disabilities use their devices. b. People with visual impairments can use Android's TalkBack to allow a device to speak screen text or text that you provide to help them understand the purpose and contents of a view. c. Android's Explore by Touch enables the user to touch the screen to hear TalkBack speak what's on the screen near the touch. d. All of the above are true.

d

Which of the following statements is false? a. A theme gives an app a look-and-feel that's consistent with Android. b. Projects that you create for Android 5 and higher use themes that adhere to Google's material- design guidelines. c. There are several predefined material design themes: The "light" theme has a white app bar, a white app background and text that is black or shades of dark gray. d. When designing a GUI, you must choose from the predefined themes.

d

Which of the following statements is false? a. An active Activity is visible on the screen and "has the focus"—that is, it's in the foreground. You can interact with the Activity currently in the foreground. b. A stopped activity is not visible on the screen—it's in the background and is likely to be killed by the system when its memory is needed. c. An Activity is stopped when another Activity enters the foreground and becomes active. For example, when you answer a phone call, the phone app becomes active and the app you previously were using is stopped. d. Each activity lifecycle method you override must call the subclass's version; otherwise, an exception will occur.

d

Which of the following statements is false? a. An app can have many activities, and an Activity can manage multiple Fragments. b. You interact with an Activity through views—GUI components that inherit from class View (package android.view). c. Before Android 3.0, a separate Activity was typically associated with each screen of an app. d. On a tablet, each Fragment typically occupies the entire screen and the Activity switches between the Fragments, based on user interactions.

d

Which of the following statements is false? a. To reach the largest possible audience, you should consider designing your apps so that they can be customized for various locales and spoken languages. b. You might also choose to use different colors, graphics and sounds based on the locale. c. When the user launches the app, Android automatically finds and loads the resources that match the device's locale settings. d. Designing an app so it can be customized is known as localization. Customizing an app's resources for each locale is known as internationalization.

d

Which of the following statements is true? a. Android apps are developed with Java—one of the world's most widely used programming languages. b. Java was a logical choice for the Android platform, because it's powerful, free, open source and used by millions of developers. c. Experienced Java programmers can quickly dive into Android development, using Google's Android APIs (Application Programming Interfaces) and others available from third parties. d. All of the above.

d

Which of the following statements is true? a. Extensible Markup Language (XML) is a natural way to express GUIs. b. XML is human- and computer-readable text and, in the context of Android, helps you specify the layouts and components to use, as well as their attributes, such as size, position, color, text size, margins and padding. c.You use XML files to store app resources, such as strings, numbers and colors. d. All of the above are true.

d

Which of the following was a new Android 3.0 developer feature: a. fragments, which describe portions of an app's user interface and can be combined into one screen or used across multiple screens. b. a persistent Action Bar at the top of the screen providing users with options for interacting with apps. c. ability to use multicore processor architectures for enhanced performance d. All of the above.

d

You must build an object of a class before a program can perform the tasks that the class's methods define. The process of doing this is called ________. a. creation. b. allocation. c. building. d. instantiation.

d

You'll use class (package java.text) to create locale-specific currency and percentage strings—an important part of internationalizing your apps. a. LocaleFormat b. StringFormat c. InternationalFormat d. NumberFormat

d

Before running an app in the Android emulator, you'll need to create a(n) ________, which defines the characteristics of the device on which you want to test, including the hardware, system image, screen size, data storage and more. a. Android Virtual Device (AVD) b. Cloud Test Lab. c. Android Device Emulator (ADE) d. None of the above.

a

Google now introduces many new Android features via the Android Support Library—a set of libraries that enable you to . a. use newer Android features in apps targeting current and past Android platforms b. use new Android features only in the current Android platform version c. use old Android features in new Android platforms d. None of the above.

a

Google's ________ look-and-feel for Android and web applications was the key new feature in Lollipop. It helps you create apps with nice transition effects, shadows that add depth to the user interface and emphasize actionable components, customization capabilities and more. a. material design. b. holo c. GUI d. None of the above.

a

In 2007, the ________ was formed to develop, maintain and evolve Android, driving innovation in mobile technology and improving the user experience while reducing costs. a. Open Handset Alliance. b. Open Phone Alliance. c. Open Software Foundation. d. Open Software Alliance.

a

In a layout XML file, attribute values that begin with @, such as @dimen/activity_vertical_margin are ________ with values defined in other files. a. resources b. variables c. dimentions d. None of the above.

a

In addition to directly programming portions of your apps, you'll also use the Android Studio IDE to conveniently ________ predefined objects such as buttons and textboxes into place on your screen, and label and resize them. a. drag and drop b. point and click c. copy and paste d. None of the above.

a

Which Android Marshmallow feature is described by: "Tap and hold the home button while inside any app and Google Now inspects what's on the screen and presents relevant information in the form of cards. For example, in a text message discussing a movie, a card containing information about that movie is displayed. a. Now on Tap. b. Tap for Card. c. Tap on Screen. d. None of the above.

a

Which of following statements is false? a. You create the AndroidManifest.xml file when you create a new app project. b. Settings you specify in the Create New Project dialog include the app's name, package name, Activity name(s) and more. c. You can edit the AndroidManifest.xml file's XML to add a new setting that forces the soft keyboard to be displayed when the app begins executing. d. You'll also specify that the app supports only portrait orientation—that is, the device's longer dimension is vertical.

a

Which of the following statements is false? a. If you need to customize theme colors, Google's material design guidelines for color recommend that you choose a color palette consisting of a primary color—with no more than five hues (shades)—and an accent color. b. The primary colors typically are used to color the status bar and the app bar at the top of the screen and also can be used in your GUI. c. The accent color is used to tint various views in your GUI, such as SeekBars, CheckBoxes and RadioButtons. d. Once you choose a palette, you can use Android Studio's Theme Editor to modify a theme's colors.

a

Which of the following statements is false? a. You should use density-independent pixels for font sizes, and scale-independent pixels for dimensions of views and other screen elements. b. Defining your GUIs with density-independent pixels enables the Android platform to scale the GUI, based on the pixel density of a given device's screen. c. One density-independent pixel is equivalent to one pixel on a 160-dpi screen. d. On a 240-dpi screen, each density-independent pixel will be scaled by a factor of 240/160 (i.e., 1.5). So, a component that's 100 density-independent pixels wide will be scaled to 150 actual pixels wide.

a

Which of the following statements is true? a. To reach the most users with your apps, you should consider customizing them for various locales and spoken languages. b. Configuring your app so that it can be customized for various locales is known as localization. c. Customizing your app for a specific locale is known as internationalization. d. All of the above statements are false.

a

You'll use an anonymous inner class to implement the interface (from package android.widget) to respond to the user moving the SeekBar's thumb. a. SeekBar.OnSeekBarChangeListener b. SeekBar.ChangeListener c. SeekBar.OnChangeListener d. None of the above.

a

________ are views that contain and arrange other views. a. Layouts. b. TextViews. c. ImageViews. d. None of the above.

a

A new class of objects can be created quickly and conveniently by ________—the new class absorbs the characteristics of an existing one, possibly customizing them and adding unique characteristics of its own. a. customization. b. inheritance. c. copying. d. None of the above.

b

A(n) ________is a subclass of Text-View that can display text and accept text input from the user. a. TextBox b. EditText c. TextField d. EditInput

b

Android Studio provides a ________ for quickly and easily adding translations for existing strings in your app. a. Translator b. Translations Editor c. Converter d. None of the above.

b

Android Studio's app templates have been updated to use the library, enabling the new apps you create to run on almost all Android devices, including ones with older Android versions. a. Compatibility b. AppCompat c. SupportLibrary d. None of the above.

b

Android ________ checks your project for common errors, and makes suggestions for better security-, enhanced performance, improved accessibility, internationalization- and more. Some checks occur as you build your apps and write code. a. Cleanser. b. Lint. c. Error Checker. d. None of the above.

b

Android uses a collection of ________, which are named groups of related, predefined classes. Some of these are Android specific, some are Java specific and some are Google specific. They allow you to conveniently access Android OS features and incorporate them into your apps. a. modules. b. packages. c. containers. d. None of the above.

b

At the time Android How to Program, 3/e was written, there were over 1.6 million apps in Google Play, and the number is growing quickly. a. 160 thousand. b. 1.6 million. c. 16 million. d. 160 million.

b

The ________ , included in the Android SDK, allows you to run Android apps in a simulated environment within Windows, Mac OS X or Linux, without using an actual Android device. a. Android simulator. b. Android emulator. c. Android device. d. None of the above.

b

The code editors for Java and XML help you write code quickly and correctly via ________—as you type, you can press Enter (or Return) to automatically finish a Java code element or an XML element name, attribute name or value that is currently highlighted in the code-completion window. a. code-for-me b. code-completion c. automated coding d. None of the above.

b

The multitouch screens allow you to control the device with ________ involving one touch or multiple simultaneous touches. a. actions. b. gestures. c. gesticulations. d. None of the above.

b

Throughout its life, an Activity can be in one of several states—active (i.e., running), or stopped. a. halted b. paused c. ceased d. discontinued

b

To simulate a long press gesture on the Android emulator: a. double click the mouse. b. click and hold the mouse. c. click the mouse once. d. click, hold and drag the mouse.

b

Unlike Apple's ________ iOS, which is available only on Apple devices, Android is available on devices from dozens of original equipment manufacturers (OEMs) and through numerous telecommunications carriers worldwide. a. open source b. proprietary c. universal access d. None of the above.

b

When you set a view's property, Android automatically casts a shadow for that view. a. shadow b. elevation c. altitude d. levitation

b

Which Android KitKat feature is described by the following: "The status bar at the top of the screen and the menu buttons at the bottom can be hidden, allowing your apps to fill more of the screen. Users can access the status bar by swiping down from the top of the screen, and the system bar (with the back button, home button and recent apps button) by swiping up from the bottom." a. full-screen mode. b. immersive mode. c. immersion mode. d. None of the above.

b

Which of the following statements is false? a. It's considered good practice to place strings, string arrays, images, colors, font sizes, dimensions and other app resources in XML files within the subfolders of the project's res folder, so these resources can be managed separately from your app's Java code. b. If you externalize color values, it becomes more difficult to update all components that use the same color. c. If you wish to localize your app in several languages, storing the strings separately from the app's code allows you to change them easily. d. In your project's res folder, the subfolder values contains a strings.xml file that's used to store the app's default language strings—English for our apps.

b

Which type of app template is described by: "Used for a single-screen app (similar to Blank Activity) that occupies the entire screen, but can toggle visibility of the device's status bar and the app's app bar." a. Empty Activity. b. Fullscreen Activity. c. Master/Detail Flow. d. None of the above.

b

A SeekBar listeners's method executes when the user moves the SeekBar's thumb. a. onThumbMoved b. userMovedThumb c. onProgressChanged d. None of the above

c

A represents an integer in the range 0-100 by default and allows the user to select a number in that range by moving its thumb. a. GridLayout b. EditText c. SeekBar d. None of the above

c

Activities transition between their states in response to various . a. actions b. steps c. events d. deeds

c

Android uses a special folder-naming scheme to automatically choose the correct localized resources. You can name these folders with region information—values-en-rUS would contain a strings.xml file for United States English and ________ would contain a strings.xml file for United Kingdom English. a. values-en-rUK b. values-en-rEN c. values-en-rGB d. values-en-rBR

c

By default, the Seekbar allows you to select values from a. 1 to 100 b. 1 to 256 c. 0 to 100 d. 0 to 256

c

Classes ________ (i.e., wrap) attributes and methods into objects—an object's attributes and methods are intimately related. a. encumber. b. enclose. c. encapsulate. d. envelop.

c

Each time you drop a view onto the GridLayout in the Component Tree window, the view is placed in the layout's next open cell, unless you specify otherwise by . a. setting the view's layout:row property b. setting the view's layout:column property c. setting both the view's layout:row and layout:column properties d. None of the above.

c

If localized resources are not provided for a given locale, Android uses the app's default resources—that is, those in the res folder's ________ subfolder. a. defaults b. english c. values d. strings

c

Layout files like activity_main.xml are app ________ and are stored in subfolders of the project's res folder. a. code b. descriptions c. resources d. None of the above.

c

Many of today's Android phones use AMOLED displays. On such displays, a black pixel is turned off and does not consume power. Apps that use mostly black themes can reduce power consumption by approximately . a. 10% b. 70% c. 40% d. 90%

c

One of the most significant new features in Android 2.3 was support for ________ —a short-range wireless connectivity standard that enables communication between two devices within a few centimeters. It can be used for payments (for example, touching your Android device to a payment device on a soda machine), exchanging data such as contacts and pictures, pairing devices and accessories and more. a. WiFi. b. Bluetooth. c. near-field coomunication (NFC). d. None of the above.

c

The ________ folder contains the files you'll edit to create your apps' GUIs and logic. a. java b. res c. app d. manifests

c

The ________ window provides access to all of the project's files. a. Organizer b. Explorer c. Project d. None of the above.

c

The default layout for an Empty Activity is a . a. GridLayout b. LinearLayout c. RelativeLayout d. None of the above.

c

To center the text in the TextView if it wraps to multiple lines, you can set its ________ property to center. a. alignment b. weight c. gravity d. positioning

c

When you first switch your device to French and enable TalkBack, Android will automatically download the ________ engine. a. English-to-French. b. Translations. c. French text-to-speech. d. French Transalation.

c

Which of the following is a set of APIs for incorporating Google functionality into your apps? a. Google Android Services b. Google App Services c. Google Play Services. d. None of the above.

c

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 Settings-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.

a

Which of the following statements is false? a. You can reuse a class many times to build many objects. b. The overhead of reusing classes instead of building new ones can discourage reuse. c. Reuse also helps you build more reliable and effective systems, because existing classes and components often have gone through extensive testing, debugging and performance tuning. d. Just as the notion of interchangeable parts was crucial to the Industrial Revolution, reusable classes are crucial to the software revolution that has been spurred by object technology.

b

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.

b

Which of the following three statements is false? a. The Blank Activity template is a backward-compatible app template (for Android 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.

b

Which of the next three statements is false? a. By default, there are no margins—spacing that separates views—around a GridLayout's cells. b. The material design guidelines recommend 18dp minimum spacing between views. c. GridLayout can enforce the recommended spacing between views. With the GridLayout selected in the Component Tree, in the Properties window, check the GridLayout's useDefaultMargins property (which sets it to true) to use the recommended margins around the layout's cells. d. All of the above statements are true.

b

________ are software components stored on one computer that can be accessed by an app (or other software component) on another computer over the Internet. a. GUIs b. Web services. c. Classes. d. None of the above.

b

Why would you set the digits property of an EditText to 0123456789? a. To allow only characters other than the digits 0-9 to be entered. b. To allow only the string of digits 0123456789 to be entered. c. To allow only digits to be entered (in any order and combination). d. None of the above

c

Which gesture is used to flip item-by-item through a series, such as photos? a. drag. b. long press. c. pinch zoom. d. swipe.

d

You can ________ an app so that you can provide localized strings in different languages. a. translate. b. convert. c. transcribe. d. internationalize.

d

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

b

Objects, or more precisely the ________ objects come from, are essentially reusable software components. a. methods. b. packages. c. APIs. d. classes.

d

(True/False) For a TextView font color, you should typically create a color resource using a color selected from Google's Material Design color palette.

T

(True/False) It's considered good practice to define all strings, numeric values and other values in XML resource- files that are placed in the subfolders of a project's resources folder.

F

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.

a

By default, a SeekBar's range is 0 to 100 and its current value is indicated by its property. a. progress b. value c. thumb d. None of the above.

a

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

a

Method is called whenever the SeekBar's thumb position changes. a. onProgressChanged b. onSeekBarChanged c. onThumbPositionChanged d. onValueChanged

a

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

a

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

a

The ________ attribute specifies how long the animation lasts in milliseconds. a. android:duration b. android:length c. android:playbackTime d. android:time

a

Which of the following is false regarding the manifest's activity element? a. android:name is the app's name. b. android:label is the Activity's name. c. android:screenOrientation specifies the Activity's orientation. d. android:windowSoftInputMode can be used to specify that the soft keypad should be displayed immediately when the app executes and should reappear each time the user returns to the app.

a

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.

a

Which of the following statements is false? a. App-Activity is an indirect subclass of Activity that supports using newer Android features apps running on current and older Android platforms. b. You implement interface TextWatcher of package android.text to respond to events when the user changes the text in an EditText. c. You implement interface SeekBar.OnSeekBarChangeListener of package android.widget to respond to the user moving the SeekBar's thumb. d. Class NumberFormat of package java.text provides numeric formatting capabilities, such as locale-specific currency and percentage formats.

a

Which of the following statements is false? a. You must create methods onCreateOptionsMenu and onOptionsItemSelected 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.

a

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 manifest file. d. All of the above statements are false.

a

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.

a

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

a

A FragmentManager can use ________ to dynamically add, remove and transition between Fragments. a. Transactions b. FragmentTransactions c. FragmentTransitions d. Transitions

b

A class's attributes are specified by the class's ________. a. instance methods. b. instance variables. c. packages. d. None of the above.

b

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

b

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

b

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

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

b

Each app has a theme that defines the default look-and-feel of the standard views you use. The theme is specified in the app's AndroidManifest.xml file. You can customize aspects of an app's theme, such those that define an app's color scheme, by defining style resources in the file located in the app's res/values folder. a. themes.xml b. styles.xml c. colors.xml d. None of the above.

b

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

b

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

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

b

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

b

Method onCreate typically initializes the Activity's instance variables and views. This method should be as simple as possible so that the app loads quickly. If the app takes longer than five seconds to load, the operating system will display a(n) dialog, giving the user the option to forcibly terminate the app. a. PNR (Program Not Responding) b. ANR (Application Not Responding) c. ANR (Android Not Responding) d. None of the above.

b

Rather than declaring a resource, using it in a try block and closing it in a finally block, you can use the ________ statement to declare the resource in the try block's parentheses and use the resource in the try block. The resource is implicitly closed when ________. a. b. try-with-resources c. d.

b

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

b

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

b

The call to setContentView receives the R.layout constant indicating the XML file that represents a GUI—e.g., R.layout.activit_main represents the activity_main.xml file. Method setContentView uses this constant to load the corresponding XML document, which Android parses and converts into the app's GUI. This process is known as the GUI. a. creating b. inflating c. fabricating d. building

b

Which of the following statements about class R's nested classes is false? a. class R.drawable contains constants for any drawable items, such as images, that you put in the various drawable folders in your app's res folder. b. class R.id contains constants for the views in your HTML layout files. c. class R.layout contains constants that represent each layout file in your project (such as, activity_main.xml). d. class R.string contains constants for each String in the strings.xml file.

b

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 SharedPreferences.Editor object.

b

You can use Collections method ________ to randomize the order of the elements in an ArrayList<String>. a. reorder b. shuffle c. srand d. randomize

b

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

c

Class Activity's method takes an int constant representing a specific view's ID and returns a reference to the view. a. findId b. findView c. findViewById d. None of the above.

c

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

c

For apps you submit to the Google Play store, the is used as the app's unique identifier. a. app name b. class name c. package name d. folder name

c

For precise monetary calculations, use class (package java.math)—rather than type double—to represent the monetary amounts and perform calculations. a. MonetaryAmount b. Cash c. BigDecimal d. None of the above.

c

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 determine whether there is an Activity to handle the Intent. a. findActivity b. findActivityForIntent c. resolveActivity d. resolveActivityForIntent

c

In the manifest, the activity element's nested element determines which Intent types can launch an Activity-. a. intent b. filter c. intent--filter d. filter-intents

c

Method inflate returns a reference to a ________ that contains the inflated GUI. a. Layout b. Inflator c. View d. RelativeLayout

c

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

c

When you install and launch an app for the first time, calling PreferenceManager method setDefaultValues sets the app's default preferences—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

c

Which of the following statements about Intents is false? a. Intents are Android's mechanism for communicating between executable components—such as activities, background services and the operating system. b. You state your intent, then Android uses intent messaging to coordinate the executable components to accomplish what you intend to do. c. This tight coupling makes it easy to mix and match parts of different applications. d. You tell Android what you want to accomplish, then let Android find the installed applications with activities that can handle the task.

c

You specify the number of times an animation should repeat with Animation method ________. a. setRepetitions b. repetitions c. setRepeatCount d. repeatCount

c

Which of the following statements is false? a. Class Bundle of package android.os stores key-value pairs of information—typically representing an app's state or data that needs to be passed between activities. b. When another app is about to appear on the screen—e.g., when the user receives a phone call or launches another app—Android gives the currently executing app the opportunity to save its state in a Bundle. The Android runtime might subsequently kill the app—e.g., to reclaim its memory. c. When the app returns to the screen, the Android runtime passes the Bundle of the previously saved state to Activity method onStart. d. We can use Bundles to pass data between activities.

c

________ allows you to use software and data stored in the "cloud"—i.e., accessed on remote computers (or servers) via the Internet and available on demand—rather than having it stored on your desktop, notebook computer or mobile device. a. Desktop computing. b. Sky computing. c. Cloud computing. d. None of the above.

c

________ 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

c

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

d

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

d

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

d

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

d

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

d

Handler- method ________ receives as arguments a Runnable to execute and a delay in milliseconds. After the delay has passed, the Handler's Runnable executes in the same thread that created the Handler. a. executeDelayed b. runDelayed c. handleDelayed d. postDelayed

d

IOExceptions are ________ exceptions (so you must catch or declare the exception). a. required b. important c. special d. checked

d

If the Java compiler can infer a generic object's type from the context, you can replace <type> 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

d

Implement interface ________ to respond to Button events. The method receives the clicked Button as a parameter. a. OnTouchListener b. OnButtonClickListener c. OnButtonTouchListener d. OnClickListener

d

Method ________ is called when a menu item is selected. a. onOptionSelected b. onMenuItemSelected c. onItemSelected d. onOptionsItemSelected

d

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

d

Method onCreateView is called after onCreate to build and return a View containing the Fragment's GUI. This method receives a(n) ________, which you'll use to programmatically inflate a Fragment's GUI from the components specified in a predefined XML layout. a. Inflater b. GUICreator c. GUIInflater d. LayoutInflater

d

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

d

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

d

When a color state list resource is provided for a Button color (either foreground 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

d

When the virtual keyboard is displayed, the device's back button changes to a down button that enables you to . a. scroll down the screen b. dismiss the app's current activity and return to the prior one. c. hide the app d. dismiss the keyboard

d

Which of the following actions does not change the device's configuration? a. rotating the device b. connecting to a Bluetooth keyboard c. sliding out a hard keyboard d. All of the above change the device's configuration.

d

Which of the following is false? a. Each Activity in an app must be declared in AndroidManifest.xml; otherwise, 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 foreground, rather than creating a new MainActivity object. d. Each of the above is true.

d

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

d

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 buttons 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.

d

Which of the following statements is false? a. A Fragment typically represents a reusable portion of an Activity's user interface, 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.

d

Which of the following statements is false? a. If an Intent matches only one Activity's intent-filter, Android executes that Activity. b. If there are multiple matches, Android presents a list from which the user can choose an app, then executes the appropriate Activity in that app. c. An Intent often contains data the Activity can use to perform its task. d. The intent-filter element optionally can contain one or more action elements.

d

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.

d

Which of the following statements is true? a. The default activity_main.xml layout embeds (via an <include> element in the XML) the GUI defined in content_main.xml. b. The default activity_main.xml layout also contains a FloatingActionButton—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 FloatingActionButton (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.

d

Which of the following three statements is true? a. You arrange a GUI's views in layouts. b. A GridLayout (package android-.widget) arranges views into cells in a rectangular grid. c. Cells in a GridLayout can occupy multiple rows and columns, allowing for complex layouts. d. All of the above statements are true.

d

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 Monitor's LogCat tab or with the Android logcat tool. d. Each of the above statements is true.

d

Which of the next three statements is false? a. style resources can define common property values that should be applied to multiple views. b. You apply a style resource to a given view by setting its style property. c. Any subsequent changes you make to a style are automatically applied to all views using the style. d. All of the above statements are true.

d

You can use a(n) ________ object to delay the performance of an action. a. DelayedAction b. ActionHandler c. TaskHandler d. Handler

d

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

d

You can use the new Android Studio to change the app's primary, dark primary and accent colors. a. Color Editor b. Design Editor c. Layout Editor d. Theme Editor

d

(True/False) You can have only one project open in the IDE at once.

F


Related study sets

Advanced Cell Biology Chapter 2 Oxford Insight

View Set

Biology Chapter 17 Key Questions

View Set

ACCT 3130 Final Exam Quiz Questions Review

View Set

Chapter 9 Health Promotion of the Infant and Family

View Set

Cellular & Molecular Basis of Medicine, Exam 4

View Set

UGA Poultry Processing-Cut Up and Deboning and Marination

View Set

module - 2 Atherosclerosis & Hyperlipidemia

View Set