HOMEWORK 2 — State, Navigation & Room ====================================== Mobile Application Development | SUZA | Semester II 2025/2026 Weight: 15% | Individual work | Due: end of Week 9 TASK — Build a "PocketBudget" app --------------------------------- An app that lets a student track day-to-day expenses with monthly totals. FEATURES (all required) ----------------------- 1. Three screens linked by Navigation-Compose: a. DashboardScreen — total for the current month + list of recent expenses b. AddExpenseScreen — form to add a new expense c. HistoryScreen — all expenses grouped by month (LazyColumn + sticky headers) 2. Expense entity in Room: id (auto), amount (Double), category (String), note (String?), timestamp (Long = epoch ms) 3. Categories: enum { Food, Transport, Books, Bills, Other } Add an exhaustive "when" branch — adding a new category must force the compiler to remind you of every call-site. 4. MVVM architecture: - ExpenseDao, ExpenseRepository, ExpenseViewModel - ViewModel exposes StateFlow> and StateFlow> for monthly totals 5. UI features: - Add button opens AddExpenseScreen (returning to dashboard on save) - Tap expense → delete confirmation dialog - Empty state illustration when there are no records - Currency formatted to 2 decimals (e.g. "Tsh 12,500.00") - Keyboard types: Number for amount 6. Validation: - Amount must be > 0 - Category required - Save button disabled until valid STRETCH (optional, +10 pts bonus) --------------------------------- - Add a simple bar chart (Canvas Composable) showing expense by category - Export the current-month list to a CSV file via the system share sheet GRADING RUBRIC (100 pts) ------------------------ Architecture & layering (ViewModel/Repo/DAO) 20 Room setup and correctness (entity, DAO, migrations) 20 Navigation flow between screens 10 Compose UI quality and state hoisting 15 Empty / loading / error states handled 10 Validation & UX polish 10 Tests (≥ 1 unit test + ≥ 1 UI test) 10 Code cleanliness and documentation 5 SUBMISSION ---------- - GitHub repo "mad-hw2-" - README.md with screenshots, architecture diagram, build instructions - Short demo video (≤ 90 sec) - Submit repo URL on Moodle