islamarr / nasa_app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nasa App

About this project

๐Ÿš€ Simple list of APODs with + Sorting by date / title + add to favorite.

๐Ÿ›  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.
  • Other tools/plugins

    • Obfuscation, Code shrinking - Obfuscation is to reduce your app size by shortening the names of the appโ€™s classes, methods, and fields. Shrinking to make the app as small as possible.
    • SonarLint plugin - Static Code Analysis that identifies and helps you fix quality and security issues as you code.

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 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.
  • 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:

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

Other Projects

About


Languages

Language:Kotlin 100.0%