The Media APIs are used to play and, in some cases, record media files. This includes audio (e.g., play MP3s or other music files, ringtones, game sound effects, or DTMF tones) and video (e.g., play a video streamed over the web or from local storage).
Other special classes in the package offer the ability to detect the faces of people
in Bitmaps (FaceDetector
), control audio routing (to the device or a headset)
and control alerts such as ringtones and phone vibrations (AudioManager
).
AudioManager.OnAudioFocusChangeListener | Interface definition for a callback to be invoked when the audio focus of the system is updated. |
AudioRecord.OnRecordPositionUpdateListener | Interface definition for a callback to be invoked when an AudioRecord has
reached a notification marker set by setNotificationMarkerPosition(int)
or for periodic updates on the progress of the record head, as set by
setPositionNotificationPeriod(int) . |
AudioTrack.OnPlaybackPositionUpdateListener | Interface definition for a callback to be invoked when the playback head position of an AudioTrack has reached a notification marker or has increased by a certain period. |
JetPlayer.OnJetEventListener | Handles the notification when the JET engine generates an event. |
MediaPlayer.OnBufferingUpdateListener | Interface definition of a callback to be invoked indicating buffering status of a media resource being streamed over the network. |
MediaPlayer.OnCompletionListener | Interface definition for a callback to be invoked when playback of a media source has completed. |
MediaPlayer.OnErrorListener | Interface definition of a callback to be invoked when there has been an error during an asynchronous operation (other errors will throw exceptions at method call time). |
MediaPlayer.OnInfoListener | Interface definition of a callback to be invoked to communicate some info and/or warning about the media or its playback. |
MediaPlayer.OnPreparedListener | Interface definition for a callback to be invoked when the media source is ready for playback. |
MediaPlayer.OnSeekCompleteListener | Interface definition of a callback to be invoked indicating the completion of a seek operation. |
MediaPlayer.OnVideoSizeChangedListener | Interface definition of a callback to be invoked when the video size is first known or updated |
MediaRecorder.OnErrorListener | Interface definition for a callback to be invoked when an error occurs while recording. |
MediaRecorder.OnInfoListener | Interface definition for a callback to be invoked when an error occurs while recording. |
MediaScannerConnection.MediaScannerConnectionClient | An interface for notifying clients of MediaScannerConnection when a connection to the MediaScanner service has been established and when the scanning of a file has completed. |
MediaScannerConnection.OnScanCompletedListener | Interface for notifying clients of the result of scanning a requested media file. |
SoundPool.OnLoadCompleteListener | Interface definition for a callback to be invoked when all the sounds are loaded. |
AsyncPlayer | Plays a series of audio URIs, but does all the hard work on another thread so that any slowness with preparing or loading doesn't block the calling thread. |
AudioFormat | The AudioFormat class is used to access a number of audio format and channel configuration constants. |
AudioManager | AudioManager provides access to volume and ringer mode control. |
AudioRecord | The AudioRecord class manages the audio resources for Java applications to record audio from the audio input hardware of the platform. |
AudioTrack | The AudioTrack class manages and plays a single audio resource for Java applications. |
CamcorderProfile | The CamcorderProfile class is used to retrieve the predefined camcorder profile settings for camcorder applications. |
CameraProfile | The CameraProfile class is used to retrieve the pre-defined still image capture (jpeg) quality levels (0-100) used for low, medium, and high quality settings in the Camera application. |
ExifInterface | This is a class for reading and writing Exif tags in a JPEG file. |
FaceDetector | Identifies the faces of people in a
Bitmap graphic object. |
FaceDetector.Face | A Face contains all the information identifying the location of a face in a bitmap. |
JetPlayer | JetPlayer provides access to JET content playback and control. |
MediaMetadataRetriever | MediaMetadataRetriever class provides a unified interface for retrieving frame and meta data from an input media file. |
MediaPlayer | MediaPlayer class can be used to control playback of audio/video files and streams. |
MediaRecorder | Used to record audio and video. |
MediaRecorder.AudioEncoder | Defines the audio encoding. |
MediaRecorder.AudioSource | Defines the audio source. |
MediaRecorder.OutputFormat | Defines the output format. |
MediaRecorder.VideoEncoder | Defines the video encoding. |
MediaRecorder.VideoSource | Defines the video source. |
MediaScannerConnection | MediaScannerConnection provides a way for applications to pass a newly created or downloaded media file to the media scanner service. |
RemoteControlClient | RemoteControlClient enables exposing information meant to be consumed by remote controls capable of displaying metadata, artwork and media transport control buttons. |
RemoteControlClient.MetadataEditor | Class used to modify metadata in a RemoteControlClient object. |
Ringtone | Ringtone provides a quick method for playing a ringtone, notification, or other similar types of sounds. |
RingtoneManager | RingtoneManager provides access to ringtones, notification, and other types of sounds. |
SoundPool | The SoundPool class manages and plays audio resources for applications. |
ThumbnailUtils | Thumbnail generation routines for media provider. |
ToneGenerator | This class provides methods to play DTMF tones (ITU-T Recommendation Q.23), call supervisory tones (3GPP TS 22.001, CEPT) and proprietary tones (3GPP TS 31.111). |