Skip to content

alexstvn/practice-map

Repository files navigation

🎼 Practice Map

An Android app that turns any sheet music PDF into an interactive practice tracker. Musicians upload a score, draw sections directly on top of the music, and the app keeps track of when each section was last practiced — surfacing what's overdue so practice time gets spent where it's actually needed.

Built for NUMAD (Native/Mobile App Development) — Team 11.

🎯 Features

  • PDF Score Upload: Import any sheet music PDF from device storage, preview it, and save it to a personal library with a custom name and default practice frequency
  • Visual Section Editor: Draw rectangular "blocks" directly over passages in the score to mark them as practice sections — supports multi-line/repeated passages by grouping multiple blocks into one section
  • Undo/Redo Support: Full undo/redo stack while drawing and editing sections, so mistakes are never permanent
  • Practice Tracking: Tap any section while viewing a score to log a practice session, set a custom interval, add notes, or mark it fully completed
  • "Practice All" Shortcut: Mark every section in a score as practiced for the day in one tap
  • Color-Coded Overlays: Sections are visually color-coded based on how overdue they are for practice, giving an at-a-glance view of what needs attention
  • Persistent Library: Browse, rename, adjust frequency, or delete saved scores (and all associated sections/practice data) from a scrollable library screen
  • Page Navigation: Multi-page PDF support with per-page section/block rendering

🛠️ Tech Stack

Platform:

  • Android (Java), minSdk 35 / targetSdk 36, Gradle Kotlin DSL (build.gradle.kts)

Architecture:

  • MVVM pattern with ViewModel + LiveData for reactive UI updates
  • Repository layer abstracting database access from ViewModels

Persistence:

  • Room (androidx.room, v2.7.1) for local relational storage
  • Room auto-migrations for schema evolution across versions

PDF Handling:

  • androidx.pdf:pdf-viewer and pdf-viewer-fragment for in-app PDF preview
  • android.graphics.pdf.PdfRenderer for rendering individual pages to bitmaps for the custom overlay system

UI Components:

  • Material Components (com.google.android.material) for buttons and dialogs
  • RecyclerView for the score library list
  • ConstraintLayout for responsive screen layouts
  • Custom View overlays (EditableScoreOverlay, ViewableScoreOverlay) for drawing/tapping directly on rendered PDF pages
  • Edge-to-edge display support via androidx.activity.EdgeToEdge

Testing:

  • JUnit for unit tests
  • Espresso + AndroidX Test for instrumented UI tests

📁 Project Structure

app/src/main/java/com/example/numad26sp_team11_practicemap/
├── MainActivity.java              # App entry point / home screen
├── UploadScoreActivity.java       # PDF selection, preview, and initial save
├── database/                      # Room database + DAOs
│   ├── AppDatabase.java
│   ├── PdfScoreDao.java
│   ├── ScoreBlockDao.java
│   └── ScoreSectionDao.java
├── model/                         # Room entities
│   ├── PdfScore.java              # A saved score (name, file URI, default interval)
│   ├── ScoreBlock.java            # A drawn rectangle tied to a section + page
│   └── ScoreSection.java          # A practice unit (interval, last practiced, notes)
├── repository/                    # Data access abstraction over DAOs
│   ├── PdfRepository.java
│   ├── BlockRepository.java
│   └── SectionRepository.java
├── viewmodel/                     # MVVM ViewModels
│   ├── PdfScoreViewModel.java
│   ├── BlockViewModel.java
│   └── SectionViewModel.java
├── library/                       # Score library screen (RecyclerView list)
│   ├── LibraryActivity.java
│   ├── RviewAdapter.java
│   ├── RviewHolder.java
│   └── ScoreClickListener.java
├── sectioneditor/
│   └── SectionEditorActivity.java # Draw/edit sections over a rendered PDF page
├── scoreview/
│   └── ScoreViewActivity.java     # Practice mode: view score, tap sections to log practice
├── scoreoverlay/                  # Custom drawing overlays on top of PDF pages
│   ├── BaseScoreOverlay.java
│   ├── EditableScoreOverlay.java  # Draw mode (used in editor)
│   ├── ViewableScoreOverlay.java  # Tap-to-log mode (used in practice view)
│   ├── OverlayMode.java
│   └── OnBlockTappedListener.java
└── practiceentry/
    └── PracticeEntryActivity.java # Log a practice session for a section

🚀 Getting Started

Prerequisites

  • Android Studio (recent stable release)
  • Android SDK 36 (compile/target), minimum SDK 35
  • JDK 11

Installation

  1. Clone the repository
git clone https://github.com/alexstvn/practice-map.git
cd practice-map
  1. Open the project in Android Studio and let Gradle sync (pulls dependencies from Google's Maven repo and Maven Central)

  2. Run on an emulator or physical device (API 35+) via the ▶️ Run button, or from the command line:

./gradlew installDebug

💡 Key Functionalities

Uploading a Score

  • Pick any PDF from device storage via the system document picker
  • Preview the PDF in-app before committing
  • Set a score name and a default practice interval (in days)
  • Persistent read-URI permission is requested so the file stays accessible after the picker closes

Drawing Practice Sections

  • After upload, the user is dropped into the Section Editor to draw blocks over the score
  • "Add Section" mode draws a brand-new section; "Add to Previous Section" mode lets a block be attached to an existing section (for passages that repeat across the page or span multiple lines)
  • Every drawn/deleted block pushes onto an undo/redo stack
  • Empty sections (created but never assigned a block) are cleaned up automatically when the editor closes

Practicing a Score

  • The Score View renders the PDF with color-coded overlays showing which sections are due for practice
  • Tapping a section opens the Practice Entry screen to log today's date, adjust the practice interval, add notes, or mark the section fully completed
  • A "Practiced All" button logs every section in the score as practiced for the current day in one action

Data Model

  • PdfScore → the top-level saved score (name, file URI, default interval)
  • ScoreSection → a logical practice unit with its own interval override, last-practiced date, completion flag, and notes
  • ScoreBlock → the actual drawn rectangle(s) on a given page tied to a section (a section can own multiple blocks for repeated/multi-line passages)

📊 Database Schema (Room)

PdfScore (scores)

  • id, scoreName, practiceInterval (default days between practices), fileUri

ScoreSection (score_sections)

  • id, scoreId, practiceInterval (nullable override), lastPracticedDate, isCompleted, notes

ScoreBlock (score_blocks)

  • id, scoreId, sectionId, pageNumber, rectangle coordinates (left, top, right, bottom)

👥 Team

Built by Team 11 as part of a Native/Mobile App Development (NUMAD) course project.

About

Android app that turns sheet music PDFs into an interactive practice tracker: draw practice sections on a score and track when each one is due for review.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors