Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Login

Register Now

Welcome to All Test Answers

Android How to Program Chapter 13 Solution Manual


 

Download  file with the answers

If you are not a member register here to download this file 


 

13 Enhanced Slideshow
App
Obj e c t i v e s
In this chapter you’ll:
■ Use an Intent and content
resolvers to allow the user to
select videos from the
device’s media library.
■ Use the device’s rear-facing
camera to take new pictures
to add to the slideshow.
■ Use SurfaceView,
SurfaceHolder and
Camera objects to display a
photo preview with various
color effects.
■ Use an VideoView to play
videos.
■ Use Serializable objects
to save and load slideshows.
■ Use ObjectOutputStream
and FileOutputStream to
save slideshows to a device.
■ Load slideshows from the
device with
ObjectInputStream and
FileInputStream.
2 Chapter 13 Enhanced Slideshow App
Self-Review Exercises
13.1 Fill in the blanks in each of the following statements:
a) Use a to play videos.

b) To use an object with the serialization mechanism, implement the interface
Serializable.

c) A can determine when a video finishes playing.

13.2 State whether each of the following is true or false. If false, explain why.
a) A serialized object is represented as a sequence of bytes that includes the object’s data
and information about the object’s type.

b) (True/False) Objects of a class that implements Serializable are tagged as being Serializable
objects—that is, any object of a class that implements Serializable can be
serialized.

c) (True/False) The VideoView maintains its own MediaPlayer to play the video.

d) (True/False) The Context class provides methods for accessing the file system.

e) (True/False) When the SurfaceView is created, changed or destroyed, its SurfaceHolder’s
Callback methods are called.

Exercises
13.3 Fill in the blanks in each of the following statements:
a) To use an object with the serialization mechanism, the object’s class must implement
the interface, which is a tagging interface.

b) A serialized object can be read from a file and —that is, the type information
and bytes that represent the object and its data can be used to recreate the object
graph in memory. This is accomplished with an ObjectInputStream that reads the bytes
from a specified InputStream.

c) ObjectOutputStream’s method returns the deserialized object as type Object.
To use it in an app, you must cast the object to the appropriate type.

d) The SurfaceHolder.Callback interface’s method is called each time the
size or format of the SurfaceView changes—typically when the device is rotated and
when the SurfaceView is first created and displayed.
ANS: surfaceChanged.
e) Read and deserialize objects with an ObjectInputStream’s method.

Exercises 3
13.4 State whether each of the following is true or false. If false, explain why.
a) (True/False) You can use a MediaPlayer.OnFinishListener to determine when a
video finishes playing so we can continue playing.

b) (True/False) Camera’s static open method can get a Camera object that allows the
app to use the device’s rear facing camera.

4 Chapter 13 Enhanced Slideshow App
Exercises 5
6 Chapter 13 Enhanced Slideshow App

About

Leave a reply

Captcha Click on image to update the captcha .

error: Content is protected !!