Accounting
Anthropology
Archaeology
Art History
Banking
Biology & Life Science
Business
Business Communication
Business Development
Business Ethics
Business Law
Chemistry
Communication
Computer Science
Counseling
Criminal Law
Curriculum & Instruction
Design
Earth Science
Economic
Education
Engineering
Finance
History & Theory
Humanities
Human Resource
International Business
Investments & Securities
Journalism
Law
Management
Marketing
Medicine
Medicine & Health Science
Nursing
Philosophy
Physic
Psychology
Real Estate
Science
Social Science
Sociology
Special Education
Speech
Visual Arts
Computer Science
Q:
Which of the following statements is false?
a. When a Fragment is attached to an Activity, its lifecycle is tied to that of its parent Activity.
b. There are six Activity lifecycle methods that have corresponding Fragment lifecycle methodsonCreate, onStart, onResume, onPause, onStop and onDestroy.
c. When the system calls any of the methods onCreate, onStart, onResume, onPause, onStop and onDestroy on an Activity, it will also call these corresponding methods (and potentially other Fragment lifecycle methods) on only the Activity's attached primary Fragment.
d. 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.
Q:
(True/False) Media files, such as the sounds, are placed in the app's resource folder res/raw.
Q:
To add a custom component to a layout's XML file, you must provide its class name.
Q:
You can create a customview by extending class ________ or one of its subclasses.
Q:
Each Activity in an app must be declared in the app's ________ file; otherwise, Android will not know that the Activity exists and will not be able to launch it.
Q:
(True/False) The DialogFragment's onCreateDialog method uses an ________ to configure and create an AlertDialog, then returns it.
Q:
(True/False) Log static method e is used to log error messages.
Q:
(True/False) IOExceptions are unchecked exceptions.
Q:
(True/False) Activity is an indirect subclass of Context.
Q:
LayoutInflater's inflate method returns ________.
Q:
You can use a ________ object to perform an action after a delay.
Q:
Toast method makeText receives as arguments the Context on which the Toast is displayed, the message to display and the ________. Toast method show displays the Toast.
Q:
Method ________ is called when a menu item is selected.
Q:
Returning true from onCreateOptionsMenu indicates that ________.
Q:
We use the WindowManager to get a Display object that contains the screen's current width and height, which changes based on the ________.
Q:
(True/False) We override Activity method onCreateOptionsMenu to initialize Activity's standard options menu.
Q:
(True/False) When an app first executes, overridden Activity lifecycle method onStart is before after onCreate.
Q:
Resources method getConfiguration returns a Configuration object (package android.content.res) that contains public instance variable screenLayout, which you can use to determine the device's ________.
Q:
Inherited method getResources returns the app's Resources object (package android.content.res) that can be used to ________ and determine information about the app's environment.
Q:
________ method getDefaultSharedPreferences returns a reference to the SharedPreferences object representing the app's preferences, and SharedPreferences method registerOnSharedPreferenceChangeListener registers the listener.
Q:
Android chooses the activity_main.xml file from the ________ folder if the app is running in portrait orientation or ________ if the app is running on a tablet in landscape orientation.
Q:
(True/False) By default, animations in an animation set are applied sequentially (i.e., one after the other).
Q:
For the android:toXDelta attribute, if we specify the value -5%p, it indicates that the View should move to the ________ (due to the minus sign) by 5% of the parent's width (indicated by the p).
Q:
(True/False) The android:fromXDeltaattribute is the View's offset when a translate animation starts and the android:toXDeltaattribute is the View's offset when the animation ends.
Q:
Which of the following statements is false?a. An animation set is a collection of animations that make up a larger animation.b. Property animation types include alpha (transparency), scale (resize), translate (move) and rotate.c. A translate animation moves a View within its parent.d. Property animations can animate any property of any object.
Q:
The PreferenceFragment property ________ specifies the name of a preference stored in the app's SharedPreferences.
Q:
The property ________, when set to true, causes a PreferenceFragment to store a preference's value each time it changes.
Q:
(True/False) The qualifiers large and land ensure that any layouts defined in a particular folder will be used only on large devices on which the app is running in landscape orientation.
Q:
For each Fragment layout, you"ll add a layout XML file to your app's ________ and specify which Fragment class the layout is associated with.
Q:
(True/False) All of an app's Fragments must use the same layout.
Q:
(True/False) Font sizes should be specified in scale-independent pixels (sp) so that fonts in your app can also be scaled by the user's preferred font size (as specified in the device's settings).
Q:
(True/False) Typically, colors are defined in a file named colors.xml, which Android creates for you.
Q:
Why should color resources be defined in XML?
Q:
(True/False) All of your app's resources in the res/values folder must be defined in specific files based on the type of the resourcesfor example, array resources must be defined in arrays.xml, colors in colors.xml, Strings in strings.xml and numeric values in values.xml.
Q:
(True/False) When a String resource contains multiple format specifiers you must number the format specifiers for localization purposes. A d in a format specifier formats an integer; an f in one formats a floating-point number.
Q:
(True/False) Suppose your app dynamically loads image file names and stores them in an ArrayList<String>. You can use Collections method randomize to shuffle the order of the image file names for each new game.
Q:
(True/False) When exceptions occur, you can log them for debugging purposes with Android's built-in logging mechanism. Android provides class Log with several static methods that represent messages of varying detail.
Q:
Which of the statements in a), b) and c) is true?a. You can perform a shake animation by applying an Animation to an ImageView.b. We use AnimationUtils static method load Animation to load the animation from an XML file that specifies the animation's options.c. We can specify the number of times an animation should repeat with Animation method setRepeatCount and perform the animation by calling View method startAnimation (with the Animation as an argument) on the ImageView.d. Statements a), b) and c) are all true.
Q:
Which of the following statements is false?
a. You can make your app to display something for a few seconds then move on by using a Handler.
b. Handler method postDelayed receives as arguments a Runnable to execute and a delay in milliseconds.
c. After the delay has passed, the Handler's Runnable executes in the same thread that created the Handler.
d. Operations that interact with or modify the GUI must be performed in the GUI thread, because GUI components are thread safe.
Q:
(True/False) A Toast displays a message that remains on the screen until the user dismisses it. Toasts are often used to display minor error messages or informational messages.
Q:
(True/False) We can use Android's WindowManager to obtain a Display object that contains the display's current width and height. This changes with the device's orientationin portrait orientation, the device's height is less than its width.
Q:
For an app's MainActivity, you can use size and orientation qualifiers to determine which layout to use. The MainActivity layout activity_main.xml in a project's res/layout-large-land folder is used only on ________ devices (i.e., tablets) when the app is in ________ orientation.
Q:
(True/False) You typically provide images and other visual resources in the highest available resolution so Android can scale each appropriately for each particular device's pixel density.
Q:
(True/False) Resource subfolder names that begin with other contain XML files that do not fit into the other resource categories. These are often raw XML data files used by the app.
Q:
(True/False) Resource subfolder names that begin with menu contain XML files that describe the contents of menus. When you create a project, the IDE automatically defines a menu with a Settings option.
Q:
Resource subfolder names that begin with ________ contain resource files (such as audio clips) that are read into an app as streams of bytes.
Q:
(True/False) Resource subfolder names that begin with color contain XML files that define a list of colors for various states, such as the states of a Button (unpressed, pressed, enabled, etc.).
Q:
In Java, a property is typically implemented in a class as an instance variable with both ________.
Q:
Resource subfolder names that begin with animator contain XML files that define ________, which change the value of a property of an object over time.
Q:
Resource subfolder names that begin with anim contain XML files that define ________, which can change an object's transparency, size, position and rotation over time.
Q:
(True/False) Unlike an app's drawable folders, which require their image contents to be at the root level in each folder, the assets folder may contain files of any type and they can be organized in subfolders.
Q:
A List Preference's items are ________, whereas any number of items can be selected in a Multi Select List Preference.
Q:
If the Activity needs to interact with a Fragment that's declared in the Activity's layout and has an Id, the Activity can call FragmentManager method ________ to obtain a reference to the specified Fragment.
Q:
A parent Activity manages its Fragments with a ________ that's returned by the Activity's getFragmentManager method.
Q:
Which of the following statements is false?
a. Unlike activities, Fragments do not have lifecycles.
b. The onCreatemethod is called when a Fragment is created.
c. The onCreateViewmethod is called after onCreate to build and return a View containing the Fragment's GUI.
d. The onCreateView method receives a LayoutInflater, which you"ll use to programmatically inflate a Fragment's GUI from the components specified in a predefined XML layout.
Q:
(True/False) Fragments can be hosted by an Activity, or they can execute independently.
Q:
Which of the statements in a), b) and c) is false?
a. You can combine several fragments to create user interfaces that take advantage of tablet screen sizes.
b. You can easily interchange fragments to make your GUIs more dynamic.
c. Class SettingsFragment is a subclass of PreferenceFragment, which can automatically maintain an app's user preferences in a SharedPreferences file on the device.
d. All of the preceding statements are true.
Q:
A ________ typically represents a reusable portion of an Activity's user interface, but may also represent reusable program logic.
Q:
When the user selects a menu item, Activity method ________ responds to the selection.
Q:
The options menu is an object of class Menu. To specify Menu options, you override Activity's ________ method to add the options to the method's Menu argument.
Q:
(True/False) When an EditText receives the focus, its corresponding soft keyboard is displayed.
Q:
(True/False) When the first GUI component in the GUI is an EditText, Android gives that component the focus when the app loads.
Q:
All apps support ________ orientation(s) by default.
a. neither portrait nor landscape
b. only landscape
c. only portrait
d. both portrait and landscape
Q:
An Intent includes a Bundle of ________additional information that's passed to the Activity that handles the Intent. For example, an e-mail Activity can receive the e-mail's subject, CC and BCC addresses, and the body text.
Q:
In addition to buttons, an AlertDialog can display a list of items in a ________.
Q:
Any local variable or method parameter that will be used in an anonymous inner class must be declared ________.
Q:
Passing an Intent to the inherited Activity method startActivity starts an Activity that can perform the specified action on the given data. If we"ve specified to view a URI, the Intent launches the device's ________ to display the corresponding web page.
Q:
(True/False) Many constants are defined in the Intent class describing actions such as searching, choosing, sending and playing.
Q:
The first argument of Intent's constructor is ________.
Q:
(True/False) Intents can be used to launch other activities in the same app or in other apps.
Q:
The ? in AdapterView<?> is a ________ in Java generics indicating method onItemClick can receive an Adapter-View that displays any type of data.
Q:
To change a SharedPreferences object's contents, you must first call its edit method to obtain a(n) ________ object, which can add key"value pairs to, remove key"value- pairs from, and modify the value associated with a particular key in a SharedPreferences file.
Q:
You create the AlertDialog by calling the AlertDialog.Builder's create method and display the modal dialog by calling AlertDialog's ________ method.
Q:
(True/False) According to the Android design guidelines for dialogs, most dialogs need titles.
Q:
An AlertDialog.Builder object helps you configure and create an AlertDialog. The argument to the constructor is the ________ in which the dialog will be displayed.
Q:
Lengthy data access should not be done in the UI thread; otherwise, the app will display an ________ (ANR) dialog, typically after five seconds of preventing the user from interacting with the app.
Q:
(True/False) You use the method getSharedPreferences (inherited from class Context) to get a SharedPreferences object that can read existing tag"query pairs from an app's shared preferences. The first argument indicates the name of the file that contains the data. The second argument is a constant that specifies the accessibility of the filethese constants can be combined with the bitwise AND operator.
Q:
When you call setContentView and pass the constant R.layout.activity_main, Android ________the GUI from activity_main.xml.
Q:
(True/False) The onCreate method is called by the system when the app loads; if the app's process was killed by the operating system while the app was in the background, and the app is then restored; and each time the configuration changes, such as when the user rotates the device or opens or closes a physical keyboard.
Q:
When you create an app project, the IDE generates ________ as a subclass of Activity and provided the shell of an overridden onCreate method, which every Activity subclass must override.