Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

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

Rating
-
Sold
-
Pages
28
Grade
A+
Uploaded on
18-02-2022
Written in
2022/2023

Android How To Program 3rd Edition By Deitel & Deitel – Test Bank Q1. Media files (such as the sounds we used in the Cannon Game app), are placed in the app’s resource folder . 1. res/media 2. res/sounds 3. res/raw 4. res/multimedia Answer: c. res/raw • Activity and Fragment Lifecycle Methods Q1. Which of the following statements is false? 1. 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. 2. We used the onDestroy method in the MainActivityFragment to release the CannonView’s sound resources. 3. Method onDestroy is guaranteed to be called, so it can be used to release resources and to save critical data. 4. The Android documentation recommends that you save data in methods onPause or onSaveInstanceState. Answer: c. Method onDestroy is guaranteed to be called, so it can be used to release resources and to save critical data. Actually, method onDestroy is not guaranteed to be called, so it should be used only to release resources, not to save critical data. • Overriding View Method onTouchEvent Q1. To process simple touch events in an app, override View method onTouchEvent, then use constants from class (package ) to test which type of event occurred and process it accordingly. 1. Event 2. MotionEvent 3. Motion 4. View Answer: b. MotionEvent • Adding Sound with SoundPool and AudioManager Q1. An app’s sound effects are managed with a(n) (package ), which can be used to load, play and unload sounds. 1. Effects 2. SoundPool 3. EffectsPool 4. SoundManager Answer: SoundPool Q2. Sounds are played using one of Android’s audio- for alarms, music, notifications, phone rings, system sounds, phone calls and more. 1. streams 2. players 3. tools 4. None of the above Answer: a. streams Q3. The Android documentation recommends that games use the to play sounds, because that stream’s volume can be controlled via the device’s volume buttons. 1. phone audio stream 2. alarm audio stream 3. notifications audio stream 4. music audio stream Answer: d. music audio stream Q4. Which of the following statements is false? 1. You configure and create a SoundPool object using a SoundPool.Builder object. 2. You use an AudioAttributes.Builder object to create an AudioAttributes object that will be associated with the SoundPool.

Show more Read less
Institution
Course

Content preview

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

Chapter 6 Cannon Game App

• Introducti
on No
questions.

• Test-Driving the Cannon Game
App No questions.

• Technologies
Overview No questions.

• Using the Resource Folder res/raw

,Q1. Media files (such as the sounds we used in the Cannon Game
app), are placed in the app’s resource folder .

1. res/media
2. res/sounds
3. res/raw
4. res/

multimedia

Answer: c.

res/raw

• Activity and Fragment Lifecycle Methods

Q1. Which of the following statements is false?

1. 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.
2. We used the onDestroy method in the MainActivityFragment
to release the CannonView’s sound resources.
3. Method onDestroy is guaranteed to be called, so it can be
used to release resources and to save critical data.
4. The Android documentation recommends that you save data in
methods onPause or onSaveInstanceState.

Answer: c. Method onDestroy is guaranteed to be called, so it can be
used to release resources and to save critical data. Actually, method
onDestroy is not guaranteed to be called, so it should be used only to
release resources, not to save critical data.

• Overriding View Method onTouchEvent
Q1. To process simple touch events in an app, override View
method onTouchEvent, then use constants from class (package
android.view) to test which type of event occurred and process it
accordingly.

1. Event
2. MotionEvent
3. Motion
4. View

Answer: b. MotionEvent

, • Adding Sound with SoundPool and AudioManager
Q1. An app’s sound effects are managed with a(n)

(package android.media), which can be used to load, play and
unload sounds.

1. Effects
2. SoundPool
3. EffectsPool
4. SoundManag

er Answer:

SoundPool


Q2. Sounds are played using one of Android’s audio- for
alarms, music, notifications, phone rings, system sounds, phone
calls and more.

1. streams
2. players
3. tools
4. None of the

above Answer: a.

streams


Q3. The Android documentation recommends that games use the
to play sounds, because that stream’s volume can be controlled
via the device’s volume buttons.

1. phone audio stream
2. alarm audio stream
3. notifications audio stream
4. music audio stream

Answer: d. music audio

stream


Q4. Which of the following statements is false?

Written for

Course

Document information

Uploaded on
February 18, 2022
Number of pages
28
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$14.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
brainsmaster Walden University
Follow You need to be logged in order to follow users or courses
Sold
28
Member since
4 year
Number of followers
25
Documents
948
Last sold
3 months ago

3.8

8 reviews

5
4
4
1
3
1
2
1
1
1

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions