Skip to content

πŸš€ Advanced Android app showcasing MVI + Clean Architecture with complete modularization, MediaStore integration, Room database, and modern UI patterns

Notifications You must be signed in to change notification settings

epegasus/Modularization-Sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Modularization Sample - Advanced Android Application

A comprehensive Android application demonstrating modern modularization patterns with MVI + Clean Architecture, featuring advanced media handling, Room database integration, and sophisticated permission management.

πŸ“‹ Table of Contents

🎯 Overview

This project showcases a production-ready Android application built with modern development practices, featuring:

  • Complete Modularization: Each feature is independently developed and testable
  • Clean Architecture: Clear separation of concerns with Data, Domain, and Presentation layers
  • MVI Pattern: Model-View-Intent architecture for predictable state management
  • Advanced Media Handling: MediaStore integration with zoomable images and ExoPlayer videos
  • Room Database: Local storage for favorites with proper data management
  • Permission Management: Comprehensive permission handling for Android 6-16
  • Modern UI: Material Design 3 with ViewBinding
  • Type-Safe Navigation: Jetpack Navigation with compile-time safety

πŸ—οΈ Architecture

Clean Architecture Layers

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Presentation Layer                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   Images    β”‚ β”‚   Videos    β”‚ β”‚ Favourites  β”‚ β”‚ Settings   β”‚ β”‚
β”‚  β”‚   Feature   β”‚ β”‚   Feature   β”‚ β”‚   Feature   β”‚ β”‚   Feature  β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Domain Layer                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   Images    β”‚ β”‚   Videos    β”‚ β”‚ Favourites  β”‚ β”‚ Settings   β”‚ β”‚
β”‚  β”‚   Domain    β”‚ β”‚   Domain    β”‚ β”‚   Domain    β”‚ β”‚   Domain   β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       Data Layer                                β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   Images    β”‚ β”‚   Videos    β”‚ β”‚ Favourites  β”‚ β”‚ Settings   β”‚ β”‚
β”‚  β”‚    Data     β”‚ β”‚    Data     β”‚ β”‚    Data     β”‚ β”‚    Data    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Core Modules                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚    Core     β”‚ β”‚   Database  β”‚ β”‚ MediaStore  β”‚ β”‚ Navigation β”‚ β”‚
β”‚  β”‚   (Common)  β”‚ β”‚   (Room)    β”‚ β”‚   (Media)   β”‚ β”‚ (Abstract) β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                                β”‚
β”‚  β”‚   Theme     β”‚                                                β”‚
β”‚  β”‚ (Styling)   β”‚                                                β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

MVI Pattern Implementation

The application follows the Model-View-Intent (MVI) pattern for predictable state management:

  • Intent: User actions and system events
  • Model: Immutable state representing the UI
  • View: Reactive UI that renders the current state
User Action β†’ Intent β†’ ViewModel β†’ State β†’ UI Update

πŸ“¦ Module Structure

ModularizationSample/
β”œβ”€β”€ :core/                     # Common utilities and base classes
β”œβ”€β”€ :core:database/            # Room database setup and entities
β”œβ”€β”€ :core:mediastore/         # MediaStore API wrapper and permissions
β”œβ”€β”€ :core:navigation/          # Navigation abstraction and interfaces
β”œβ”€β”€ :core:theme/               # Theme and styling resources
β”‚
β”œβ”€β”€ :data:images/              # Images data layer
β”œβ”€β”€ :domain:images/            # Images domain layer  
β”œβ”€β”€ :feature:images/           # Images presentation layer
β”‚
β”œβ”€β”€ :data:videos/              # Videos data layer
β”œβ”€β”€ :domain:videos/            # Videos domain layer
β”œβ”€β”€ :feature:videos/           # Videos presentation layer
β”‚
β”œβ”€β”€ :data:favourites/          # Favourites data layer (Room)
β”œβ”€β”€ :domain:favourites/        # Favourites domain layer
β”œβ”€β”€ :feature:favourites/       # Favourites presentation layer
β”‚
β”œβ”€β”€ :data:settings/            # Settings data layer
β”œβ”€β”€ :domain:settings/          # Settings domain layer
β”œβ”€β”€ :feature:settings/         # Settings presentation layer
β”‚
β”œβ”€β”€ :data:language/            # Language data layer
β”œβ”€β”€ :domain:language/          # Language domain layer
β”œβ”€β”€ :feature:language/         # Language presentation layer
β”‚
β”œβ”€β”€ :data:onboarding/          # Onboarding data layer
β”œβ”€β”€ :domain:onboarding/        # Onboarding domain layer
β”œβ”€β”€ :feature:onboarding/       # Onboarding presentation layer
β”‚
β”œβ”€β”€ :feature:entrance/         # Entrance screen
β”œβ”€β”€ :feature:dashboard/        # Dashboard with 4 bottom navigation items
β”œβ”€β”€ :feature:media-detail/     # Media detail screen (Images/Videos)
β”‚
└── :app/                      # Main app module

✨ Features

🎯 Core Features

  • Entrance Screen: App entry point with splash/loading
  • Language Selection: Multi-language support with persistence
  • Onboarding Flow: User onboarding experience
  • Dashboard: Main screen with 4 bottom navigation tabs
  • Media Gallery: Images and Videos from MediaStore
  • Favourites: Local storage with Room database
  • Settings: App configuration and preferences

πŸ–ΌοΈ Media Features

  • Image Gallery:

    • MediaStore integration
    • Favourite toggle functionality
    • Zoomable image viewer with PhotoView
    • Memory-optimized loading
  • Video Gallery:

    • MediaStore integration
    • Favourite toggle functionality
    • ExoPlayer with custom controls
    • Advanced video playback features
  • Media Detail Screen:

    • Zoomable image viewer for images
    • ExoPlayer for video playback
    • Favourite toggle
    • Media information display

⭐ Favourites System

  • Room Database: Local storage for favourites
  • Toggle Functionality: Add/remove favourites from any media
  • Favourites Screen: Dedicated screen showing all favourites
  • Real-time Updates: Live updates across all screens
  • Data Persistence: Favourites persist across app restarts

πŸ” Permission Management

  • Android 6-16 Support: Comprehensive permission handling
  • Limited Access Warning: Android 14+ limited access detection
  • Settings Navigation: Direct navigation to app settings
  • Permission Banner: Visual feedback for permission status
  • Graceful Degradation: App functionality with limited permissions

🎨 UI/UX Features

  • Material Design 3: Modern design system
  • ViewBinding: Type-safe view binding
  • Type-Safe Navigation: Compile-time navigation safety
  • Responsive Design: Adaptive layouts for different screen sizes
  • Dark/Light Theme: Theme support
  • Smooth Animations: Fluid user interactions

πŸ› οΈ Technology Stack

Architecture Components

  • MVI Pattern: Model-View-Intent architecture for predictable state management
  • Clean Architecture: Separation of concerns
  • Repository Pattern: Data abstraction layer
  • Use Cases: Business logic encapsulation

Core Libraries

  • Kotlin: Modern programming language
  • ViewBinding: Type-safe view binding
  • Jetpack Navigation: Type-safe navigation
  • Room Database: Local data persistence
  • Koin: Dependency injection framework
  • Coroutines & Flow: Asynchronous programming

Media Libraries

  • MediaStore API: System media access
  • ExoPlayer: Advanced video playback
  • PhotoView: Zoomable image viewer
  • Glide: Image loading and caching

Permission & Security

  • Accompanist Permissions: Permission handling
  • Security Best Practices: Secure data handling
  • Memory Management: Optimized resource usage

πŸ“± Supported Android Versions

  • Minimum SDK: Android 6.0 (API 23)
  • Target SDK: Android 16 (API 35)
  • Compile SDK: Android 16 (API 35)
  • Tested Devices: Various screen sizes and Android versions

πŸ”§ Development Environment

Prerequisites

  • Android Studio Hedgehog or later
  • JDK 17 or later
  • Android SDK 35
  • Kotlin 1.9.0 or later
  • Gradle 8.0 or later

Setup Instructions

  1. Clone the repository
  2. Open in Android Studio
  3. Sync Gradle files
  4. Run the application

πŸ“„ License

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

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“ž Support

For support and questions, please open an issue in the repository.


Note: This project demonstrates advanced Android development practices and serves as a reference implementation for modularized applications with Clean Architecture and MVI pattern.

About

πŸš€ Advanced Android app showcasing MVI + Clean Architecture with complete modularization, MediaStore integration, Room database, and modern UI patterns

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages