Skip to content
Rajesh edited this page Feb 19, 2025 · 4 revisions

Here's a comprehensive documentation for your Meditation Tracker app, structured as a GitHub Wiki. You can add screenshots in the specified sections:

Meditation Tracker App Documentation

Overview

This app helps users track their meditation progress with features like:

  • Daily timer with background functionality
  • Manual entry of meditation time
  • Goal setting and progress tracking
  • Weekly/Monthly/Yearly summaries with charts
  • Data export/import functionality
  • Dark mode support

Architecture

The app follows a modular architecture with separate activities for different features. Core components include:

  • BaseActivity: Handles navigation drawer and theme management
  • Data persistence using SQLite databases
  • MVVM pattern for data handling

Main Features

1. Main Screen (MainActivity)

Layout:

  • activity_main.xml
  • Displays current date, daily total, timer, and manual entry

Key Components:

  • Timer: Uses TimerService for background tracking
  • Manual Entry: Collects hours/minutes/seconds input
  • Goal Card: Shows progress for active goals

Screenshots: Add screenshots of the main interface here

Code Reference:

  • Timer logic: MainActivity.java (startTimer/stopTimer methods)
  • Database updates: MeditationLogDatabaseHelper (updateDailyLog)

2. Goal Management (GoalsActivity)

Layout:

  • activity_goals.xml + goal_item.xml (RecyclerView items)

Functionality:

  • Create goals with target hours and dates
  • Progress tracking with percentage display
  • Delete functionality Screenshots: Add goal creation and list views here

Code Reference:

  • Data handling: GoalsDatabaseHelper (CRUD operations)
  • Adapter: GoalsAdapter (RecyclerView population)
  • Date picker: GoalsActivity.java (showDatePickerDialog)

3. Progress Summaries

Weekly (WeeklyActivity)

  • Layout: activity_weekly.xml
  • Features:
    • Bar chart showing weekly progress
    • Navigation between weeks
  • Screenshots: Add weekly chart view here
  • Code Reference:
    • Data retrieval: MeditationLogDatabaseHelper (getWeeklyMeditationData)
    • Chart configuration: WeeklyActivity.java (updateWeeklySummary)

Monthly (MonthlyActivity)

  • Layout:
    • activity_monthly.xml
  • Features:
    • Monthly chart divided into weeks
    • Total hours display
  • Screenshots: Add monthly chart view here
  • Code Reference:
    • Data retrieval: MeditationLogDatabaseHelper (getMonthlyMeditationData)
    • Chart configuration: MonthlyActivity.java (updateMonthlySummary)

Yearly (YearlyActivity)

  • Layout:
    • activity_yearly.xml
  • Features:
    • Yearly chart with monthly data
    • Navigation between years
  • Screenshots: Add yearly chart view here
  • Code Reference:
    • Data retrieval: MeditationLogDatabaseHelper (getYearlyMeditationData)
    • Chart configuration: YearlyActivity.java (updateYearlySummary)

4. Data Management

  • Export/Import:
    • JSON and SQLite database export
    • File selection for import
  • Code Reference:
    • Export: BaseActivity.java (exportData method)
    • Import: BaseActivity.java (importData method) Screenshots: Add export/import UI here

5. Navigation & Theming

  • Navigation Drawer:
    • Implemented in BaseActivity
    • Menu items link to different activities
  • Theming:
    • Light/dark/auto theme options
    • Theme buttons in menu drawer
  • Code Reference:
    • Theme handling: BaseActivity.java (applyTheme/setThemeAndSave)
    • Drawer setup: BaseActivity.java (setupDrawer)

6. Release Notes (ReleaseNotesActivity)

  • Layout:
    • activity_releasenotes.xml + release_items.xml + release_notes.txt (RecyclerView)
  • Functionality:
    • Displays version history from release_notes.txt
    • Markdown rendering with table support
  • Screenshots: Add release notes view here
  • Code Reference:
    • Data loading: ReleaseNotesActivity.java (readReleaseNotes)
    • Markdown processing: ReleaseNotesAdapter (Markwon integration)

7. Menu drawer (BaseActivity)

  • Layout:
    • activity_menu_drawer.xml + activity_base.xml
  • Functionality:
    • Access other screens
    • Export button
    • Import button
  • Screenshots
  • Code Reference:
    • Data loading: BaseActivity.java

Database Structure

Meditation Logs Database (meditation_logs.db)

  • Table: logs
  • Columns: session_id, date, total_seconds
  • Usage:
  • Stores daily meditation time
  • Used for all summary calculations

Goals Database (goals.db)

  • Table: goals
  • Columns: _id, description, target_hours, progress_hours, start_date, end_date
  • Usage:
  • Stores user-defined goals
  • Tracks progress and dates

Dependencies

  • MPAndroidChart: For bar charts in summaries
  • Markwon: For rendering release notes in Markdown
  • Material Components: For UI elements

Code Organization

  • Activities: Each feature has its own activity (e.g., MainActivity, GoalsActivity)
  • Adapters: RecyclerView adapters for lists (e.g., GoalsAdapter)
  • Database Helpers: Separate classes for data handling (GoalsDatabaseHelper, MeditationLogDatabaseHelper)
  • Utilities: Theme management in BaseActivity

Testing Considerations

  • Unit Tests: Add test cases for database operations
  • UI Tests: Verify chart rendering and navigation
  • Edge Cases: Handle date boundaries in summary calculations

Screenshot Placement Guide: Main screen: docs/screenshots/main_screen.png Goal creation: docs/screenshots/goal_creation.png Weekly summary: docs/screenshots/weekly_summary.png Monthly summary: docs/screenshots/monthly_summary.png Yearly summary: docs/screenshots/yearly_summary.png Release notes: docs/screenshots/release_notes.png