islamarr / music_app

Simple Music app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Music_album_app

About this project

๐Ÿš€ Simple albums and music track list app.

๐Ÿ›  Simple implementation for MVI architecture pattern and Clean Architecture.

๐Ÿ›  Unit tests included.

๐Ÿ›  SOLID principles.

๐Ÿ›  Standard Coding Style.

Architecture pattern Used

MVI

Libraries & Tools Used

  • Foundation - Components for core system capabilities, Kotlin extensions and support for multidex and unit testing.
  • Test - An Android testing framework for unit and runtime UI tests.
  • Architecture - A collection of libraries that help you design robust, testable, and maintainable apps. Start with classes for managing your UI component lifecycle and handling data persistence.
    • View Binding - To more easily write code that interacts with views.
    • Lifecycles - Create a UI that automatically responds to lifecycle events.
    • Navigation - Handle everything needed for in-app navigation.
    • ViewModel - Store UI-related data that isn't destroyed on app rotations. Easily schedule asynchronous tasks for optimal execution.
    • Repository - A Module that handle data operations, You can consider repositories to be mediators between different data sources.
    • Retrofit - A simple library that is used for network transaction.
    • Hilt: For dependency injection
    • Kotlin Coroutines For managing background threads with simplified code and reducing needs for callbacks.
    • Kotlin Flows - A stream of data that can be computed asynchronously.
    • Glide - For image loading.

Technical choices

MVI vs MVVM

  • A consistent state during the lifecycle of Views.
  • As it is unidirectional, Data flow can be tracked and predicted easily.
  • It ensures thread safety as the state objects are immutable.
  • Easy to debug, As we know the state of the object when the error occurred.
  • It's more decoupled as each component fulfills its own responsibility.
  • Testing the app also will be easier as we can map the business logic for each state.
  • Read more

Hilt vs Dagger2 vs Koin

  • Hilt is built on top of the Dagger, and it comes with some advantages like simplify Dagger code and create a standard set of components and scopes to ease setup.
  • As this project is simple, Hilt is the best one. For more complex projects I will go with Dagger2 to avoid some limitation of hilt.
  • Hilt does not need factories for ViewModel, koin need.
  • Hilt generate the code in the compile time, while koin in runtime.

Coroutines vs RxJava

  • Coroutines come with many advantages over RxJava, beside that it is Kotlin-friendly design pattern, it is:
    • Lightweight: You can run many coroutines on a single thread due to support for suspension.
    • Fewer memory leaks: Use structured concurrency to run operations within a scope.
    • Built-in cancellation support.
    • Many Jetpack libraries include extensions that provide full coroutines support.

What's next

While the project scale up, Some points should be considered:

  • Analytics and tracking system should be implemented to provide insight on app usage and user engagement.
  • Pagination should be handled in all lists from backend and client side. I already handled it in search screen only.
  • More Unit & UI testing functions need to be added.

Other Projects