Skip to content

A feature-rich Android TODO app with Material Design, SQLite database, and comprehensive beginner-friendly code comments

Notifications You must be signed in to change notification settings

Brain2k-0005/todo-android-app

Repository files navigation

TODO App - Android Local Storage Assignment

A fully-featured TODO application for Android with local data persistence using SQLite and SharedPreferences.

Features Implemented

Mandatory Features (Pflicht-Features)

  1. Todo Management

    • ✅ Create new todos
    • ✅ Mark todos as completed
    • ✅ Edit existing todos
    • ✅ Delete todos
  2. Categories

    • ✅ Create categories (default: "Work", "Private", "Shopping", "Health", "Other")
    • ✅ Assign todos to categories
    • ✅ Display and manage categories
    • ✅ Edit and delete categories
  3. App Settings

    • ✅ Dark/Light theme toggle (UI implemented, theme switching not applied)
    • ✅ Notifications on/off toggle (UI implemented, no actual notifications)
    • ✅ Language selection DE/EN (UI implemented, no actual translations)
  4. Data Storage

    • ✅ All todos and categories stored in SQLite database
    • ✅ App settings stored with SharedPreferences
    • ✅ Data persists after app restart
    • ✅ Foreign key relationship between todos and categories

Bonus Features

  1. Search Function

    • ✅ Search todos by title
    • ✅ Filter by categories (via category management)
    • ✅ Filter by completed/open tasks
  2. Statistics

    • ✅ Display count of open/completed todos
    • ✅ Show completion rate percentage
    • ✅ Display todos per category
  3. Export/Import

    • ✅ Export data as JSON file
    • ✅ Import JSON backup

Technical Implementation

Architecture

  • Package Structure:
    • activities/ - All activity classes
    • adapters/ - RecyclerView adapters
    • database/ - SQLite database helper
    • models/ - Data model classes
    • utils/ - Utility classes (PreferencesManager, JsonHelper)

Database Schema

Categories Table:

  • id (INTEGER PRIMARY KEY AUTOINCREMENT)
  • name (TEXT NOT NULL)
  • color (TEXT)

Todos Table:

  • id (INTEGER PRIMARY KEY AUTOINCREMENT)
  • title (TEXT NOT NULL)
  • description (TEXT)
  • is_completed (INTEGER DEFAULT 0)
  • category_id (INTEGER, FOREIGN KEY)
  • created_date (TEXT)

Key Components

  1. DatabaseHelper.java - Singleton class handling all database operations with proper error handling and logging

  2. PreferencesManager.java - Singleton class managing SharedPreferences for app settings

  3. MainActivity.java - Main screen with RecyclerView, search, and filter functionality

  4. AddEditTodoActivity.java - Form for creating and editing todos with input validation

  5. ManageCategoriesActivity.java - CRUD operations for categories

  6. SettingsActivity.java - User preferences management

  7. StatisticsActivity.java - Data visualization and statistics

  8. JsonHelper.java - JSON export/import functionality

Dependencies

  • AndroidX AppCompat
  • Material Design Components
  • RecyclerView
  • CardView
  • Gson (for JSON serialization)
  • ConstraintLayout

Code Quality

  • ✅ Clean separation between UI and data logic
  • ✅ Error handling for database operations with try-catch blocks
  • ✅ Input validation for all form fields
  • ✅ Comprehensive code comments explaining functionality
  • ✅ Singleton pattern for database and preferences managers
  • ✅ ViewHolder pattern for efficient RecyclerView scrolling

How to Run

  1. Open the project in Android Studio
  2. Sync Gradle files
  3. Run on an emulator or physical device (minimum SDK 24 - Android 7.0)
  4. The app will create default categories on first launch

Testing Checklist

  • Create new todos and verify they persist after app restart
  • Mark todos as completed and verify state is saved
  • Edit todos and verify changes are persisted
  • Delete todos and verify they are removed from database
  • Create, edit, and delete categories
  • Search todos by title
  • Filter todos by status (All/Open/Completed)
  • View statistics
  • Toggle settings and verify they are saved
  • Export data to JSON
  • Import data from JSON backup
  • Test on different screen sizes and orientations

Known Limitations

  • Theme switching UI is implemented but does not actually change the app theme
  • Notification toggle is implemented but app does not send notifications
  • Language selection is implemented but no actual translations are provided
  • These are intentional as per assignment requirements

Author

Created for Android Development Course - Local Storage Assignment

About

A feature-rich Android TODO app with Material Design, SQLite database, and comprehensive beginner-friendly code comments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages