App Development

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Given that users are more likely to download an app if it's 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.

"lite"

Games often require complex logic that should be performed in separate threads of execution (that is, separate from the GUI thread) and those threads often need to draw to the screen. For such cases, Android provides class ________—a subclass of View to which a thread can draw, then indicate that the results should be displayed in the GUI thread.

SurfaceView

With Android's ________ you can draw on the entire screen—the device's system bars and action bar toggle between displayed and hidden when you tap the screen.

immersive mode

The Google Play ________ allows you to create licensing policies to control access to your paid apps.

licensing service

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

monetizing

Call Path's ________ method to set the Path's starting coordinates and specify the new Point's x and y values.

moveTo

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

obfuscate

The first Fragment lifecycle method called when a Fragment is attached to a parent Activity is ________.

onAttach

When the ColorDialogFragment is added to a parent Activity, method ________ is called.

onAttach

The last Fragment lifecycle method called when a Fragment is about to be detached from a parent Activity is ________.

onDetach

We override SensorEventListener method ________ to process accelerometer events.

onSensorChanged

Class View's ________ method is called whenever the View's size changes, including when the View is first added to the View hierarchy as the layout is inflated.

onSizeChanged

Game-development frameworks typically provide sophisticated "________-perfect" collision-detection capabilities.

pixel

Color's static methods alpha-, red, green and blue extract the ARGB values from the color, and SeekBar's ________ method positions the thumbs.

setProgress

Only one thread at a time can draw to a SurfaceView. To ensure this, you must first lock the SurfaceHolder by specifying it as the expression in the parentheses of a __________ block.

synchronized

Android's full-screen immersive mode enables an app to take advantage of the entire screen, but still allows the user to access the ________ when necessary.

system bars

SensorManager's GRAVITY_EARTH constant represents ________.

the acceleration due to gravity on earth

It's important to handle sensor events quickly or to copy the event data because ________.

the array of sensor values is reused for each sensor event.

Method onProgressChanged is called when the position of a SeekBar's ________ changes.

thumb

You use the type of a ________ to determine whether the user has touched the screen, dragged across the screen or lifted a finger from the screen.

touch event

Google Play's in-app billing service enables you to sell ________ goods (e.g., digital content) through apps on devices.

virtual

When processing a menu selection you use the MenuItem's ________ method to get the resource ID of the selected menu item, then take appropriate actions based on the selection.

getItemID

When a View needs to be redrawn, its onDraw method is called. The first argument is the Bitmap to draw, the next two arguments are the x-y coordinates where the upper-left corner of the Bitmap should be placed on the View and the last argument is the ________ object that specifies the drawing characteristics.

Paint

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.

PrintHelper

(True/False) Each AsyncTask can be executed many times.

False

(True/False) Google sells your apps for 99 cents on Google Play.

False

(True/False) In-app advertising generates significant revenue for most apps.

False

(True/False) Once you've tested and debugged your app on the emulator, it's ready to be posted Google Play.

False

Once you've created the icon and label, you'll need to specify them in the app's ________ file by setting the android:icon and android:label attributes of the application element.

AndroidManifest.xml

In Android, it's important to minimize the amount of work you do in the GUI thread to ensure that the GUI remains responsive and does not display ________ dialogs.

Application Not Responding (ANR)

The Android documentation for class SoundPool recommends using the stream for playing music (________) for sound in games.

AudioManager.STREAM_MUSIC

You'll need a high-resolution icon for use in Google Play. This icon should be ________ pixels. a. 256 x 256 b. 512 x 512 c. 1024 x 1024 d. 2048 x 2048

B

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

False

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

False

(True/False) You must define Drawables in the project's drawable folders for all device sizes and resolutions to be used with your app.

False

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

False

To add a custom component to a layout's XML file, you must provide its class name.

False

(True/False) A FrameLayout is designed to display many Views.

False. A FrameLayout is designed to display many Views. Actually, a FrameLayout is designed to display only one View.

(True/False) A SoundPool can play only one sound stream at once.

False. A SoundPool can play many simultaneous sound streams.

PrintHelper method printBitmap displays Android's print dialog, which allows the user to choose whether to save the image as a ________ on the device or to print the image to an available printer.

PDF document

You register to receive accelerometer events using SensorManager's register-Listener method. One of its arguments is the rate at which sensor events should be delivered to the app. Why would you specify SENSOR_DELAY_NORMAL to receive sensor events at the default rate, instead of choosing a faster rate?

Because although a faster rate can be used to get more accurate data, it would be more CPU and battery intensive.

Why would you provide an empty body for a method?

Because the method is required by an interface.

We use methods of class Canvas (package android.graphics) to draw text, lines and circles. Canvas methods draw on a View's ________.

Bitmap

Which of the following EditTexts's Input Type property values might be used to ensure that state abbreviations are displayed in capital letters? a. textPersonName|textCapWords b. textPostalAddress|textCapWords c.textPostalAddress|textCapCharacters d. number

C

The free ________ tool—which runs when you build your app in release mode—shrinks the size of your .apk file (the Android app package file that contains your app for installation) and optimizes and obfuscates the code.

ProGuard

We override View method onTouchEvent to determine when the user touches the screen. We use MotionEvent's getAction method to determine whether the user touched the screen (MotionEvent.ACTION_DOWN) or ________ (Motion-Event.ACTION_MOVE).

dragged a finger across the screen

When a View is inflated, its constructor is called with a(n) ________ and an AttributeSet as arguments.

Context

Canvas's drawRect method receives as arguments the rectangle's upper-left x-y co-ordinates, the rectangle's width and height, and the ________ object that specifies the drawing characteristics.

Paint

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.

Paint

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.

Dalvik Debug Monitor Service

With Google Play, you have the option to include with your app an ________ (EULA) —an agree-ment through which you license your software to the user.

End User License Agreement

(True/False) You want to ensure that the game operates at the same speed regardless of how fast the device is. If the time between frames is larger (i.e., the device is slower), the game elements should move less when each frame of the animation is displayed. If the time between frames is smaller (i.e., the device is faster), the game elements should move further when each frame of the animation is displayed.

False. Actually, If the time between frames is larger (i.e., the device is slower), the game elements should move further when each frame of the animation is displayed. If the time between frames is smaller (i.e., the device is faster), the game elements should move less when each frame of the animation is displayed.

(True/False) You process touch events by overriding the View method on-TouchEvent.

False. Actually, you override the View method onTouchEvent.

(True/False) SparseIntArray is similar to—but less efficient than—a HashMap<Integer, Integer> for small numbers of key-value pairs.

False. SparseIntArray is similar to—but more efficient than—a HashMap<Integer, Integer> for small numbers of key-value pairs.

(True/False) One problem with using a shake event is that even unintentional small movements always result in events.

False. You can set a threshold to ensure that movements less than this amount are not interpreted as shakes.

(True/False) You set a line's width using Paint's setLineWidth method.

False. You use Paint's setStrokeWidth method to do this.

The default location in which photos taken with the device are stored is the device's ________.

Gallery

Google's app marketplace is called ________.

Google Play

To use in-app billing, you'll 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.

Google Play Publisher

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

Google+

Your most important app brand asset is the app ________.

Icon

The Android Asset Studio provides a tool for creating app ________.

Icons

What does the following code do? if (screenSize == Configuration.SCREENLAYOUT_SIZE_XLARGE) setRequestedOrienta-tion(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); else setRequestedOrienta-tion(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

If this app is running on an extra large device, we set the orientation to land-scape; otherwise, we set it to portrait.

The ________ manages media files (images, audio and video) stored on a device.

MediaStore

To process simple touch events, you'll override View method onTouchEvent, then use constants from class ________ (package android.view) to test which type of event occurred and process it accordingly.

MotionEvent

A ________ is a ViewGroup that can contain other Views (like a layout) and that lets users scroll through content too large to display on the screen.

ScrollView

An app's sound effects are managed with a ________ (package android.media), which can be used to load, play and unload sounds.

SoundPool

Why would you double click strings.xml in the res/values folder?

To display the resource editor for creating String resources

Why would you pass true to Paint's setAntiAlias method?

To enable anti-aliasing, which smoothes the edges of lines.

Why would you call the inherited View method invalidate?

To indicate that the View needs to be redrawn.

Why would you call Paint's setStrokeCap method with Paint.Cap.ROUND?

To round the ends of lines.

(True/False) A GestureDetector allows an app to react to user interactions such as flings, single taps, double taps, long presses and scrolls by implementing the meth-ods of interfaces GestureDetector.OnGestureListener and Ges-ture-Detector.On-Double-Tap-Listener interfaces.

True

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

True

(True/False) AlertDialogs are often created using anonymous inner classes that extend DialogFragment and display only text and buttons. AlertDialogs may also contain custom Views.

True

(True/False) Inherited SurfaceView method getHolder returns the SurfaceHolder object for managing the SurfaceView, and SurfaceHolder method addCallback stores the object that implements interface SurfaceHolder.Callback.

True

(True/False) Like an Activity, a Fragment can place items in the app's action bar and options menu. To do so, the Fragment must call its setHasOptionsMenu meth-od with the argument true.

True

(True/False) Media files, such as the sounds, are placed in the app's resource folder res/raw.

True

(True/False) Method onCreateView is called after a Fragment's onCreate method to build and return a View containing the Fragment's GUI. Method onActivityCreated is called after the Fragment's host Activity is created.

True

(True/False) Sound files are stored in the app's res/raw folder.

True

(True/False) Store the image in the device's Gallery by calling class MediaS-tore.Images.Media's insertImage method. Method insertImage returns a String representing the image's location on the device, or null if the image could not be saved.

True

(True/False) The Android documentation recommends that games use the music audio stream to play sounds.

True

(True/False) The system MotionEvent passed from onTouchEvent contains touch information for multiple moves on the screen if they occur at the same time. Mo-tionEvent method getPointerCount returns the number of touches the Mo-tion-Event describes.

True

(True/False) When the user selects a menu item, Fragment method onOptionsItemSelected responds to the selection.

True

(True/False) You can associate a Canvas with a Bitmap, then use the Canvas to draw on the Bitmap, which can then be displayed on the screen. A Bitmap can also be saved into a file.

True

The Android Support Library is a set of libraries that are commonly used to provide new Android features for use in older Android versions.

True

When you upload your app to Google Play, you'll have the option to include a ________ on YouTube.

URL for a short promotional video

It's 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. .

Version Code

You can create a custom view by extending class ________ or one of its subclasses.

View

Financial transactions for paid apps in Google Play are handled by Google ________, though cus-tomers of some mobile carriers can opt to use carrier billing to charge paid apps to their wireless bill. a. Basket b. Pouch c. Wallet d. Pay

Wallet

Which of the following statements is false? a. When an Activity hosts Fragments and the Activity is paused, you must call all of its Fragments' onPause methods. b. We override onPause to suspend play in a game so that the game does not con-tinue executing when the user cannot interact with it—this saves battery power. c. When an Activity is shut down, its onDestroy method is called, which in turn calls the onDestroy methods of all the Fragments hosted by the Activity. d. We can use method onDestroy in a game Fragment to release various game re-sources resources.

a. When an Activity hosts Fragments and the Activity is paused, you must call all of its Fragments' onPause methods. [Actually, when an Activity hosts Fragments and the Activity is paused, all of its Fragments' onPause methods are called for you by Android.]

Most Android devices have a(n) ________ that allows apps to detect movement.

accelerator

SimpleOn-Gesture-Listener is an ________ class that implements interfaces OnGestureListener and OnDoubleTap-Listener.

adapter

An ARGB color contains ________ (transparency), ________, ________ and ________ componnts.

alpha, red, green, blue

Which of the following statements is false? a. Motion-Event's getActionMasked method returns an int representing the Mo-tionEvent type, which you can use with constants from class MotionEvent to de-termine how to handle each event. b. Motion-Event's getActionIndex method returns an integer index representing which finger caused the event. This index is the finger's unique ID. c. To get the finger's unique ID that persists across MotionEvents until the user re-moves that finger from the screen, we'll use Motion-Event's getPointerID meth-od, passing the finger index as an argument. d. If the action is MotionEvent.ACTION_DOWN or Motion-Event.ACTION_POINTER_DOWN, the user touched the screen with a new finger.

b. Motion-Event's getActionIndex method returns an integer index repre-senting which finger caused the event. Actually, this index is not the finger's unique ID—it's simply the index at which that finger's information is located in this MotionEvent object.

You manipulate a SurfaceView via an object of class SurfaceHolder, which enables you to obtain a Canvas on which you can draw graphics. Class SurfaceHolder also provides methods that give a thread ________ access to the Canvas for draw-ing—only one thread at a time can draw to a SurfaceView.

exclusive

. Which of the following statements is false? a. Bitmap's static createBitmap method creates a Bitmap of the specified width and height. b. The last argument to createBitmap is the Bitmap's encoding, which specifies how each pixel in the Bitmap is stored. The constant Bitmap.Config.ARGB_8888 indicates that each pixel's color has a default value of 8 for the alpha, red, green and blue components. c. A Canvas is used to draw shapes directly to a Bitmap. d. You can use Bitmap's eraseColor method to fill the Bitmap with white pixels.

b. The last argument to createBitmap is the Bitmap's encoding, which specifies how each pixel in the Bitmap is stored. The constant Bit-map.Config.ARGB_8888 indicates that each pixel's color has a default value of 8 for the alpha, red, green and blue components. Actually, the constant in-dicates that each pixel's color is represented by a 4-byte ARGB value.

Which of the following statements is false? a. Method onTouchEvent is called when the View receives a touch event. b. Android supports multitouch—that is, having multiple fingers touching the screen. c. The user must maintain the same number of fingers touching the screen for the duration of the multitouch event. d. Each finger—known as a pointer—has a unique ID that identifies it across touch events.

c. The user must maintain the same number of fingers touching the screen for the duration of the multitouch event. Actually, at any time, the user can touch the screen with more fingers or remove fingers from the screen.

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 lifecy-cle methods—onCreate, onStart, onResume, onPause, onStop and onDestroy. c. When the system calls any of the methods onCreate, onStart, onResume, on-Pause, 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.

c. When the system calls any of the methods onCreate, onStart, onResume, on-Pause, 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. [Actually, it will also call these corresponding methods (and potentially other Fragment lifecycle methods) on all of the Activi-ty's attached Fragments.]

The first two arguments of Canvas's drawCircle method represent the ________. The third argument is the circle's radius. The last argument is the Paint object specifying the circle's drawing characteristics.

coordinates of the circle's center

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.

digital certificate


Kaugnay na mga set ng pag-aaral

Organizational Communication Quiz #1

View Set

Mental health- Legal/Ethical issues Townsend CH. 3 ATI 2

View Set

Chapter 27: Plants without seeds from water to land (learning curve)

View Set

Bio Honors Chapter 5 and 6 Study Guide

View Set

World Language Pedagogy (PRAXIS 5841)

View Set

Chapter 22: Bipolar Disorders: Nursing Care of Persons with Mood Lability

View Set