4. Android Programming
Media Playback
The Android multimedia framework includes support for
playing variety of common media types, so that you can
easily integrate audio, video and images into your
applications.
You can play audio or video from media files stored in your
application's resources (raw resources), from standalone files
in the file system, or from a data stream arriving over a
network connection, all using MediaPlayer APIs.
4
7. Android Programming
Audio Capture
The Android multimedia framework includes support for
capturing and encoding a variety of common audio formats,
so that you can easily integrate audio into your applications.
You can record audio using the MediaRecorder APIs if
supported by the device hardware.
7
10. Android Programming
JetPlayer
The Android platform includes a JET engine that lets you add
interactive playback of JET audio content in your
applications.
You can create JET content for interactive playback using the
JetCreator authoring application that ships with the SDK.
To play and manage JET content from your application, use
the JetPlayer class.
10
13. Android Programming
Camera
The Android framework includes support for various cameras
and camera features available on devices, allowing you to
capture pictures and videos in your applications.
The Android framework supports capturing images and video
through the Camera API or camera Intent. Here are the
relevant classes:
Camera: This class is the primary API for controlling device
cameras. This class is used to take pictures or videos when you
are building a camera application.
13
14. Android Programming
Camera
SurfaceView: This class is used to present a live camera preview
to the user.
MediaRecorder: This class is used to record video from the
camera.
Intent: An intent action type
of MediaStore.ACTION_IMAGE_CAPTURE or MediaStore.ACTI
ON_VIDEO_CAPTURE can be used to capture images or videos
without directly using the Camera object.
14
18. Android Programming
Creating Sound Effects
SoundPool
SoundPool is designed for short files which can be kept in
memory decompressed for quick access, this is best suited for
sound effects in apps or games.
MediaPlayer
MediaPlayer is designed for longer sound files or streams, this
is best suited for music files or larger files. The files will be
loaded from disk each time create is called, this will save on
memory space but introduce a small delay (not really
noticeable).
18