Android How To Program 3rd Edition By Deitel & Deitel Test Bank

<< Auditing An International Approach 7 Edition By Bewley Test Bank Auditing A Business Risk Approach with Cases 8th Edition By Rittenberg Test Bank >>
Product Code: 222
Availability: In Stock
Price: $24.99
Qty:     - OR -   Add to Wish List
Add to Compare

Android How To Program 3rd Edition By Deitel & Deitel Test Bank

Description

WITH ANSWERS
Android How To Program 3rd Edition By Deitel & Deitel Test Bank

Chapter 5 Doodlz App

  • Introduction

Q1. Android requires the users permission to allow an app to save files. In Android 6.0, the app ________.

  1. prompts the user at installation time with a complete list of permissions the app requires.
  2. prompts the user at installation time and execution time with a complete list of permissions the app requires.
  3. requests each permission individually at execution time, only when the permission is required to perform a given task for the first time.
  4. None of the above.

Answer: c. requests each permission individually, only when the permission is required to perform a given task for the first time

  • Test-Driving the Doodlz App in an Android Virtual Device (AVD)

Q1. 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 0255.

  1. transparency
  2. translucency
  3. alpha
  4. None of the above.

Answer: c. alpha

  • Technologies Overview

No questions.

  • Activity and Fragment Lifecycle Methods

Q1. Which of the following statements is false?

  1. A Fragments lifecycle is tied to that of its parent Activity.
  2. There are six Activity lifecycle methods that have corresponding Fragment lifecycle methodsonCreate, onStart, onResume, onPause, onStop and onDestroy.
  3. 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 Activitys attached Fragments.
  4. An Activitys onResume method is called when a Fragment is on the screen and ready for the user to interact with it.

Answer: b. There are six Activity lifecycle methods that have corresponding Fragment lifecycle methodsonCreate, onLoad, onResume, onPause, onStop and onDestroy. Actually, there are six Activity lifecycle methods that have corresponding Fragment lifecycle methodsonCreate, onStart, onResume, onPause, onStop and onDestroy.

 

Q2. Which of the following statements is false?

  1. When an Activity hosts Fragments and the Activity is resumed, all of its Fragments onResume methods are called.
  2. An Activitys onPause method is called when another Activity receives the focus, which pauses the one that loses the focus and sends it to the background.
  3. When an Activity hosts Fragments and the Activity is paused, all of its Fragments onPause methods are called.
  4. When an app is paused, it should ensure that listeners for sensor events are still active.

Answer: d. When an app is paused, it should ensure that listeners for sensor events are still active. Actually, when an app is paused, it should remove listeners for sensor events so these events are not delivered to the app when its not on the screen. This saves battery.

  • Custom Views

No questions.

  • Using SensorManager to Listen for Accelerometer Events

Q1. Most devices have a(n) ________ for detecting device movement.

  1. accelerator
  2. speed sensor
  3. accelerometer
  4. None of the above.

Answer: c. accelerometer

  • Custom DialogFragments

No questions.

  • Drawing with Canvas, Paint and Bitmap

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

  1. Draw
  2. Characteristics
  3. Settings
  4. Paint

Answer: d. Paint

  • Processing Multiple Touch Events and Storing Lines in Paths

Q1. A ________ object (package android-.graphics) represents line segments and curves.

  1. Segment
  2. Line
  3. Path
  4. Curve

Answer: c. Path

 

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

  1. Wi-Fi
  2. Bluetooth
  3. NFC
  4. Ethernet

Answer: b. Bluetooth

  • Saving to the Device

Q1. A(n) ________ (package android-.content) enables the app to read data from and store data on a device.

  1. Content-Resolver
  2. Resolver
  3. ContentAccessor
  4. None of the above

Answer: a. Content-Resolver

  • Printing and the Android Support Librarys PrintHelper Class

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

  1. Printer
  2. PrinterUI
  3. PrintHelper
  4. None of the above

Answer: c. PrintHelper

  • New Android 6.0 (Marshmallow) Permissions Model

Q1. Which of the following statements is false?

  1. Android requires the permission android.permission.WRITE_EXTERNAL_PERMISSION before an app can write to external storage.
  2. Before Android 6.0, a user was required at start time to grant in advance all permissions that an app would ever needthis caused many people not to install certain apps.
  3. 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.
  4. Once the user grants a permission, the app has that permission until the app is reinstalled or the user changes the apps permissions via the Android Settings app.

Answer: b. Before Android 6.0, a user was required at start time to grant in advance all permissions that an app would ever needthis caused many people not to install certain apps. b. Before Android 6.0, a user was required at installation time to grant in advance all permissions that an app would ever needthis caused many people not to install certain apps.

  • Adding Dependencies Using the Gradle Build System

Q1. Android Studio uses the ________ build system to compile your code into an APK filethe installable app. This system also handles project dependencies, such as including in the build process any libraries used by the app.

  1. Buck
  2. Maven
  3. Bazel
  4. Gradle

Answer: d. Gradle build

  • Creating the Project and Resources

No questions.

  • Creating the Project

No questions.

  • Gradle: Adding a Support Library to the Project

No questions.

  • xml

Q1. Googles material design specification indicates that a Buttons text should ________.

  1. use all lowercase letters
  2. use all capital letters (e.g., CANCEL or SET COLOR) for languages that support them
  3. use initial uppercase letters
  4. None of the above

Answer: b. use all capital letters (e.g., CANCEL or SET COLOR) for languages that support them

  • Importing the Material Design Icons for the Apps Menu Items

No questions.

  • MainActivityFragment Menu

Q1. We use each menu items ________ property to specify that the menu item should be displayed on the app bar if there is room.

  1. showAsAction
  2. showOnActionBar
  3. showIfRoom
  4. None of the above

Answer: a. showAsAction

  • Adding a Permission to xml

Q1. In addition to using Android 6.0s new permissions model in which the app asks the user to grant permissions dynamically, each app also must specify any permissions it uses in ________.

  1. class MainActivity
  2. strings.xml
  3. permissions.xml
  4. AndroidManifest.xml

Answer: d. AndroidManifest.xml

  • Building the Apps GUI

No questions.

  • xml Layout for MainActivity

No questions.

  • xml Layout for MainActivityFragment

No questions.

  • xml Layout for ColorDialogFragment

No questions.

  • xml Layout for LineWidthDialogFragment

No questions.

  • Adding Class EraseImageDialogFragment

No questions.

  • MainActivity Class

No questions.

  • MainActivityFragment Class

No questions.

  • package Statement, import Statements and Fields

Q1. Accelerometer information is delivered to the app as ________ values.

  1. double
  2. String
  3. float
  4. int

Answer: c. float

  • Overridden Fragment Method onCreateView

Q1. A Fragment can place items in the apps app bar and options menu. To do so, the Fragment must call its ________ method with the argument true.

  1. setHasOptionsMenu
  2. setOptionsMenu
  3. setMenu
  4. setHasMenu

Answer: a. setHasOptionsMenu

  • Methods onResume and enableAccelerometerListening

Q1. A ________ is used to register listeners for accelerometer events.

  1. AccelerometerManager
  2. ListenerManager
  3. SensorProcessor
  4. SensorManager

Answer: d. SensorManager

  • Methods onPause and disableAccelerometerListening

Q1. You use class SensorManagers ________ method to stop listening for accelerometer events.

  1. reset
  2. unregisterListener
  3. stopListening
  4. None of the above

Answer: b. unregisterListener

  • Anonymous Inner Class for Processing Accelerometer Events

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

  1. sensorChanged
  2. onSensorEvent
  3. onSensorChanged
  4. None of the above

Answer: c. onSensorChanged

  • Method confirmErase

No questions.

  • Overridden Fragment Methods onCreateOptionsMenu and onOptionsItemSelected

Q1. When the user selects a Fragments menu item, Fragment method ________  responds to the selection.

  1. onItemSelected
  2. onMenuItemSelected
  3. onOptionsItemSelected
  4. onMenuSelected

Answer: c. onOptionsItemSelected

  • Method saveImage

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

  1. shouldShowRationale
  2. shouldShowPermissionRationale
  3. shouldShowRequestRationale
  4. shouldShowRequestPermissionRationale

Answer: d. shouldShowRequestPermissionRationale

  • Overridden Method onRequestPermissionsResult

No questions.

  • Methods getDoodleView and setDialogOnScreen

Q1.  Which of the following statements is false?

  1. When an apps Fragments interact with one another directly, we call this a loosely coupled approach.
  2. Generally, a parent Activity manages an apps Fragment interactions.
  3. To pass data to a Fragment, the Activity provides a Bundle of arguments.
  4. 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.

Ans: a. When an apps Fragments interact with one another directly, we call this a loosely coupled approach. Actually this kind of direct interaction is a tightly coupled approach.

  • DoodleView Class

No questions.

  • package Statement and import Statements

No questions.

  • static and Instance Variables

No questions.

  • Constructor

Q1. Passing true to Paints ________ method enables smoothing the edges of the lines.

  1. setSmoothing
  2. setHigherResolution
  3. setAntiAlias
  4. None of the above

Answer: c. setAntiAlias

  • Overridden View Method onSizeChanged

Q1. 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 Bitmaps ________ method to release its resources.

  1. reuse
  2. recycle-
  3. release
  4. discard

Answer: b. recycle-

  • Methods clear, setDrawingColor, getDrawingColor, setLine-Width and getLineWidth

Q1. Call inherited View method ________ to indicate that the View needs to be redrawn.

  1. redraw
  2. repaint
  3. update
  4. invalidate

Answer: d. invalidate

  • Overridden View Method onDraw

Q1. When a View needs to be redrawn, its ________ method is called.

  1. onUpdateRequred
  2. onDraw
  3. onPaint
  4. None of the above

Answer: b. onDraw

  • Overridden View Method onTouchEvent

Q1. Which of the following statements is false?

  1. Motion-Events getActionMasked method returns an int representing the MotionEvent type, which you can use with constants from class MotionEvent to determine how to handle each event.
  2. Motion-Events getActionIndex method returns an integer index representing which finger caused the event. This index is the fingers unique ID.
  3. If the action is MotionEvent.ACTION_DOWN or MotionEvent.ACTION_POINTER_DOWN, the user touched the screen with a new finger. e. If the action is MotionEvent.ACTION_UP or MotionEvent.ACTION_POINTER_UP, the user removed a finger from the screen.
  4. The first finger to touch the screen generates a MotionEvent.ACTION_DOWN event, and all other fingers generate Motion-Event.ACTION_POINTER_DOWN events.

Answer: b. Motion-Events getActionIndex method returns an integer index representing which finger caused the event. This index is the fingers unique ID. Actually, this index is not the fingers unique IDits simply the index at which that fingers information is located in this MotionEvent object.

  • touchStarted Method

Q1. If a Path already exists for the given ID, we call Paths ________ method to clear any existing points so we can reuse the Path for a new stroke.

  1. erase
  2. clear
  3. reset
  4. reuse

Answer: c. reset

  • touchMoved Method

Q1. Which of the following statements is false?

  1. The system MotionEvent passed from onTouchEvent contains touch information for multiple moves on the screen if they occur at the same time.
  2. MotionEvent method getPointerCount returns the number of touches the Motion-Event describes.
  3. MotionEvent-s getX and getY methods to get the last coordinates for a drag event.
  4. MotionEvents are not generated when the user holds a finger motionless on the screen.

Answer:  d. MotionEvents are not generated when the user holds a finger motionless on the screen. Actually, many devices are sensitive enough to generate MotionEvents indicating small movements when the user is attempting to hold a finger motionless on the screen.

  • touchEnded Method

Q1.  Paths ________ method clears the Paths data.

  1. restart
  2. reset
  3. reinitialize
  4. clear

Answer: b. reset

  • Method saveImage

No questions.

  • Method printImage

Q1. PrintHelper.SCALE_MODE_FIT indicates that ________.

  1. the PrintHelper dialog should be scalled to fit on the screen
  2. the image should be scaled to fit in the PrintHelper dialog
  3. the image should fit within the printable area of the paper
  4. None of the above

Answer: c. the image should fit within the printable area of the paper

  • ColorDialogFragment Class

No questions.

  • Overridden DialogFragment Method onCreateDialog

Q1. SeekBars ________ method positions the SeekBars thumb.

  1. setPosition
  2. setProgress
  3. setValue
  4. setThumb

Answer: b. setProgress

  • Method getDoodleFragment

No questions.

  • Overridden Fragment Lifecycle Methods onAttach and onDetach

Q1. When a Fragment is removed from a parent Activity, method ________ is called.

  1. onDestruct
  2. onRemove
  3. onDisconnect
  4. onDetach

Answer: onDetach

  • Anonymous Inner Class That Responds to the Events of the Alpha, Red, Green and Blue SeekBars

Q1. Method ________ is called when the position of a SeekBars thumb changes.

  1. onSeekBarChanged
  2. onThumbPositionChanged
  3. onValueChanged
  4. onProgressChanged

Answer: onProgressChanged

  • LineWidthDialogFragment Class

No questions.

  • Method onCreateDialog

No questions.

  • Anonymous Inner Class That Responds to the Events of the widthSeekBar
  • EraseImageDialogFragment Class
  • EraseImageDialogFragment Class

No questions.

Google Play and App Business Issues

 

  • Introduction
  1. Googles app marketplace is called ________.

Ans: Google Play.

 

  1. In-app advertising and selling virtual goods are key resources for ________ apps.

Ans: monetizing

  • Preparing Your Apps for Publication
  • Testing Your App
  1. (True/False) Once youve tested and debugged your app on the emulator, its ready to be posted Google Play.

Ans: False. Although the app might work perfectly using the emulator on your computer, problems could arise when running it on actual Android devices.

 

  1. The Google Play Developer Console provides support for alpha and beta testing apps with groups of people through the ________ social network.

Ans: Google+

  • End User License Agreement
  1. With Google Play, you have the option to include with your app an ________ (EULA) an agreement through which you license your software to the user.

Ans: End User License Agreement

  • Icons and Labels
  1. The Android Asset Studio provides a tool for creating app ________.

Ans: icons

 

  1. Your most important app brand asset is the app ________.

Ans: icon 

 

  1. Youll need a high-resolution icon for use in Google Play. This icon should be ________ pixels.
  2. 256 x 256
  3. 512 x 512
  4. 1024 x 1024
  5. 2048 x 2048

Ans: b. 512 x 512

 

  1. Once youve created the icon and label, youll need to specify them in the apps ________ file by setting the android:icon and android:label attributes of the application element.

Ans: AndroidManifest.xml

  • Versioning Your App
  1. Its important to include a version name (shown to the users) and a ________ (an integer version number used internally by Google Play) for your app, and to consider your strategy for numbering updates.

Ans: version code

  • Licensing to Control Access to Paid Apps
  1. The Google Play ________ allows you to create licensing policies to control access to your paid apps.

Ans: licensing service

  • Obfuscating Your Code
  1. You should ________ any apps you upload to Google Play to discourage reverse engineering of your code and further protect your apps.

Ans: obfuscate

 

  1. The free ________ toolwhich runs when you build your app in release modeshrinks the size of your .apk file (the Android app package file that contains your app for installation) and optimizes and obfuscates the code.

Ans: ProGuard

  • Getting a Private Key for Digitally Signing Your App
  1. Before uploading your app to a device, Google Play or other app marketplaces, you must digitally sign the .apk file using a ________ that identifies you as the author of the app.

Ans: digital certificate

 

  1. (True/False) Eclipse automatically digitally signs your app when you execute it in an emulator or on a device for debugging purposes.

Ans: True

  • Screenshots
  1. The ________ (DDMS), which is installed with the ADT Plugin for Eclipse and helps you debug your apps running on actual devices, also enables you to capture screenshots on your device.

Ans: Dalvik Debug Monitor Service

  • Promotional App Video
  1. When you upload your app to Google Play, youll have the option to include a ________ on YouTube.

Ans: URL for a short promotional video

  • Pricing Your App: Free or Fee
  1. (True/False) Google sells your apps for 99 cents on Google Play.

Ans: False. You set the prices for your apps that are distributed through Google Play.

  • Paid Apps
  1. According to the app discovery site AppBrain, the average price for puzzle game apps is several times greater than that for business apps.

Ans: False. Actually, according to AppBrain the average price for puzzle game apps is much less than that for business apps.

 

  1. Financial transactions for paid apps in Google Play are handled by Google ________, though customers of some mobile carriers can opt to use carrier billing to charge paid apps to their wireless bill.
  2. Basket
  3. Pouch
  4. Wallet
  5. Pay

Ans: c. Wallet

  • Free Apps
  1. (True/False) The vast majority of apps on Google Play are paid apps.

Ans: False. Approximately 80% of apps on Google Play are free, and they comprise the vast majority of downloads.

 

  1. Given that users are more likely to download an app if its free, consider offering a free ________ version of your app to encourage users to try it. For example, if your app is a game, you might offer a free version with just the first few levels. When the user has finished playing the free levels, the app would offer an option to buy through Google Play your more robust app with numerous game levels. According to a recent study by AdMob, upgrading in this manner is the number-one reason why users purchase a paid app.

Ans: lite

  • Monetizing Apps with In-App Advertising
  1. (True/False) In-app advertising generates significant revenue for most apps.

Ans: False. In-app advertising does not generate significant revenue for most apps, so if your goal is to recoup development costs and generate profits, you should consider charging a fee for your app.

  • Monetizing Apps: Using In-App Billing to Sell Virtual Goods
  1. Google Plays in-app billing service enables you to sell ________ goods (e.g., digital content) through apps on devices.

Ans: virtual

 

  1. (True/False) According to Google, apps that use in-app billing earn profoundly more revenue than paid apps alone.

Ans: True.

 

  1. To use in-app billing, youll need a ________ account and a Google Wallet merchant account. Google pays you 70% of the revenue for all in-app purchases made through your apps.

Ans: Google Play publisher

  • Registering at Google Play
  1. (True/False) To ensure app quality, Google Play has a strict approval process for uploading apps.

Ans: False. Unlike other popular mobile platforms, Google Play has no approval process for uploading apps.

 

  1. Your app must adhere to the ________ Policies. If your app is in violation of these policies, it can be removed at any time; serious or repeated violations may result in account termination.

Ans: Google Play Developer Program

  • Setting Up a Google Wallet Merchant Account
  1. To sell your apps on Google Play, youll need a ________ merchant account, available to Google Play developers in 32 countries.

Ans: Google Wallet

  • Uploading Your Apps to Google Play
  1. When you upload your app to Google Play, you will be asked to upload a(n) ________ file that includes the apps code files, assets, resources and the manifest file.

Ans: .apk

  • Launching the Play Store from Within Your App
  1. (True/False) To drive additional sales of your apps, you can launch the Play Store app (Google Play) from within your app (typically by including a button) so that the user can download other apps youve published or purchase a related app with functionality beyond that of the previously downloaded lite version.

Ans: True.

  • Managing Your Apps in Google Play
  1. The Google Play ________ allows you to manage your account and your apps, check users star ratings for your apps (0 to 5 stars), respond to users comments, track the overall number of installs of each app and the number of active installs (installs minus uninstalls).

Ans: Developer Console

  • Other Android App Marketplaces
  1. (True/False) To make your app available to potential users, you must upload it to Google Play.

Ans: False. In addition to Google Play, you may choose to make your apps available through other Android app marketplaces, or through your own website using services such as AndroidLicenser.

  • Other Popular Mobile App Platforms
  1. Google created the open-source ________ tool to help you translate your Java app code to Objective-C for iOS apps.

Ans: J2ObjC

  • Marketing Your Apps
  1. Appolicious, Appstorm and Phandroid are all examples of ________.

Ans: Android app review sites.  

 

  1. (True/False) Most ads on Android pay based on the number of impressions generated rather than the click-through rate (CTR) of the ads.

Ans: False. Actually, most ads on Android pay based on click-through rate (CTR) of the ads rather than the number of impressions generated.

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



 

Once the order is placed, the order will be delivered to your email less than 24 hours, mostly within 4 hours. 

If you have questions, you can contact us here