Skip to content

Student Lab: Creating an Audio Player in AndroidStudio Using Java. Android version 7.0+. Audio file source: file path

License

Notifications You must be signed in to change notification settings

aok-m/AudioPlayer_labwork

Repository files navigation

🎵 Android MediaPlayer Lab Work

Student Lab: Creating an Audio Player in AndroidStudio Using Java. Android version 7.0+ Audio file source: file path

📱 Application Overview

This Android application is a fully functional audio player developed in Java using Android Studio. It plays local MP3 files stored in the device's public Downloads directory. The player features a modern UI with image effects, playlist management, and standard playback controls.

✨ Key Features

  • Playlist Support: Manages a queue of four audio tracks.
  • Playback Controls:
    • Play/Pause (single toggle button)
    • Next / Previous track
    • Loop (repeat) mode
  • Visual Experience:
    • Displays a unique cover image for each track.
    • Applies dynamic visual effects: rounded corners for the cover and a blurred background.
  • Progress Tracking:
    • Interactive SeekBar for timeline navigation.
    • Real-time display of current playback time and total track duration.
  • Android Permissions: Correctly handles runtime permissions for reading audio files (READ_MEDIA_AUDIO for API 33+, READ_EXTERNAL_STORAGE for lower versions).

🛠️ Technologies & Specifications

  • Language: Java
  • Minimum SDK: API 24 (Android 7.0 Nougat)
  • Core Component: android.media.MediaPlayer
  • Audio Format: MP3
  • Source: Local file paths (from Environment.DIRECTORY_DOWNLOADS)

🏗️ Project Structure

app/src/main/ ├── java/com/example/myapplication/ │ ├── MainActivity.java # Main activity, player logic & UI handling │ └── AudioPlayerEffects.java # Separate class for applying image effects ├── res/layout/ │ └── activity_main.xml # UI layout with RelativeLayout & LinearLayout └── AndroidManifest.xml # App permissions and configuration

🚀 Installation & Setup

  1. Clone the repository:
    git clone https://github.com/your-username/AudioPlayer_labwork.git
  2. Open the project in Android Studio.
  3. Prepare Audio Files: Place the following MP3 files in your device's or emulator's Downloads/ folder:
    • kept.mp3
    • angel.mp3
    • baptism.mp3
    • afterdark.mp3 (The app is pre-configured to look for these specific filenames).
  4. Prepare Cover Images: Ensure the corresponding drawable resources (cc1, kitty1, cc2, kitty2) are present in res/drawable/.
  5. Build and run the app on an emulator or physical device (Android 7.0+).

📸 Screenshots

Player Screen Player screen + active looping button The directory of the phone where the music is stored

⚙️ Code Design Highlights

  • Separation of Concerns: The AudioPlayerEffects class isolates image processing logic (blur, rounding) from the main player activity.
  • MediaPlayer Lifecycle: Properly managed with prepareAsync(), release(), and event listeners (OnCompletionListener, OnPreparedListener).
  • State Management: Tracks play/pause status, loop mode, and current track index.
  • UI Updates: Uses a Handler and Runnable for smooth progress bar updates.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Links

© 2025 Anna A. Petukhova.

About

Student Lab: Creating an Audio Player in AndroidStudio Using Java. Android version 7.0+. Audio file source: file path

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages