Tutorial 12 (1)
Tutorial 12 (1)
1. Draw the general architecture framework for MediaPlayer and explain the framework.
MediaPlayer Framework:
Audio/Video Source: The source of the media (e.g., local file, network stream).
MediaPlayer: The core component that manages playback, including states like playing, paused,
and stopped.
Audio/Video Output: The device's speakers or display where the media is played.
Explanation: The MediaPlayer class in Android provides methods to control playback (e.g., start,
pause, stop) and manage the lifecycle of audio/video playback. It handles decoding, buffering,
and rendering media files.
2. List the possible sources of the sound/audio playback in a mobile application.
Local Files: Audio files stored in the device's internal or external storage.
Raw Resources: Audio files stored in the res/raw folder of the app.
Network Streams: Audio streams from online sources (e.g., radio, podcasts).
Asset Files: Audio files stored in the assets folder of the app.
3. How many states are available in a MediaPlayer object? List all states.
4. What are the states involved when music is played and completed (without pause)?
When music is played and completed without pause, the following states are involved: