Chapter 3 Using Eclipse for Android Development

Chapter 3 Using Eclipse for Android Development
3.1 True/False Questions
1. The Android user interface screen is coded in the Java programming language.
Answer: False
2. An Android app should be designed for just one API.
Answer: False
3. The choice of minimum and target SDK limits how you can design your app.
Answer: True
4. Most of the core functionality of an app is provided by an activity and its associated screen (called a layout).
Answer: True
5. Android apps should have the same icon in different sizes.
Answer: True
6. The Android Manifest file is used by the Android operating system to properly implement the app’s life cycle.
Answer: False
7. The Android Manifest file is written in XML.
Answer: True
8. The Android Emulator provided by Eclipse can be configured to emulate many types of Android devices.
Answer: True
9. The Android screen or layout is designed primarily with the visual editor.
Answer: False
10. To add behavior to a button on a layout, you must get a reference to it in the associated activity.
Answer: True
3.2 Multiple Choice Questions
1. Which of the following widgets is used when you want a user to be able to enter data via the keyboard?
A. TextBox
B. TextView
C. InputBox
D. EditText
Answer: D
2. Which of the following widgets is used when you want to display static text on a layout?
A. TextBox
B. TextView
C. Label
D. LabelText
Answer: B
3. What is a workspace?
A. A folder on your computer where Eclipse keeps your projects
B. A folder in the Android app project where source code is stored
C. The location where you grab widgets to drag on to the layout
D. The location in Eclipse where you write Java code
Answer: A
4. How does the Play Store identify your apps?
A. With a key you apply for using a code from your computer
B. With a key gotten from the Google Developer Console
C. With the portion of the package name prior to the application name
D. With your code signature
Answer: C
5. How do you limit which Android devices can download your app?
A. By setting the element in the Android manifest
B. By setting the application’s minimum and target SDK
C. By setting the target device in the AVD manager
D. Not possible, all Android devices can download apps from the Play Store
Answer: B
6. Which of the following best describes an Activity?
A. An element of the app’s UI
B. An alternative name for a method in a Java class, used specifically by Android
C. A class that has the code to provide the functionality associated with a screen in an app
D. Any action taken by an Android app in response to a user selection
Answer: C
7. Which of the following best describes a Layout?
A. An XML file associated with an Activity to provide the UI
B. A widget that dictates how other widgets are organized
C. A mockup of a screen used to design user-app interaction
D. A folder that contains all the widgets available for Android UI design
Answer: A
8. Which of the following holds text values for use in an Android app?
A. textvalues.xml
B. text.xml
C. values.xml
D. strings.xml
Answer: D
9. Why does Android want you to store text values associated with a layout in a file rather than hardcode them?
A. They are taking reusable coding to the extreme.
B. To ease app maintenance.
C. So the text can more easily be adapted to different languages.
D. So the layouts can be used in more than one app.
Answer: C
10. Which of the following files holds configuration information for an Android app?
A. config.xml
B. your_app_name.xml
C. android.xml
D. AndroidManifest.xml
Answer: D
11. What is an AVD?
A. A component of the Android package used to configure the user’s device
B. A simulated device configuration for use with the emulator
C. A manager used to emulate alternative designs
D. A component of the Eclipse IDE used to update the Android SDK
Answer: B
12. What is the difference between the sp and dp dimensions in Android?
A. sp is used for data in an EditText and dp is used for static text.
B. sp is fixed (static pixel and not relative to the user’s screen size or resolution), whereas dp is relative.
C. sp is used for text and dp for other dimensions.
D. Nothing—they are interchangeable.
Answer: C
13. What is the EditText attribute android:inputType used for?
A. To modify the appearance of the EditText
B. To enable or disable hard keyboard input
C. To limit the type of data that can be entered
D. To limit the data that the user can enter, to configure the soft keyboard, and to determine how the data is configured as it is entered
Answer: D
14. Which of the following methods is required in an Android Activity?
A. onCreate
B. onPause
C. onStart
D. createActivity
Answer: A
15. Which of the following is used to pass data between activities in an app?
A. Bundle
B. Structure
C. Package
D. DataExtra
Answer: A
16. Which of the following best describes the use of the findViewById method?
A. To open a view on an activity’s layout
B. To get a reference to a widget on an activity’s layout
C. To find a widget in the Palette
D. To cast an object to a button
Answer: B
17. What is an OnClickListener?
A. A device that determines if the user clicked something on the phone
B. An object used in conjunction with a resource (R) to listen for abnormal actions
C. An object that can be added to a widget so that the widget can respond to the user tapping it
D. A line of code used to respond to clicks
Answer: C
3.3 Matching Questions
1. Match the term to the best definition.
Activity
Layout
Element
Widget
EditText
src
Manifest
Target SDK
XML
Attribute
A. An object that allows a user to enter information on a layout.
B. The configuration file for an Android app.
C. A language used to create layout files.
D. A type of object that provides the core functionality of an Android app.
E. Used to declare an object in an XML file.
F. The folder that holds the source code in an Eclipse Android project.
G. The version of Android that the app is designed for.
H. A file that defines the user interface for an activity.
I. An item used to configure a widget in an XML file.
J. A prebuilt user interface element.
Answer: D, H, E, J, A, F, B, G, C, I
|