/Sary-1

Build home page In the application"Sary" , With oop , solid principles , mvvm

Primary LanguageKotlin

Sary

Design and implement Sary flagship Android app Catalog screen For the purpose of demonstrating the use of clean architecture (MVVM, Solid Principle, OOP)

  • S.O.L.I.D priciple followed for more understandable, flexible and maintainable.

Screenshots

Fist 3 3

MVVM Best Pratice:

  • Avoid references to Views in ViewModels.

  • Instead of pushing data to the UI, let the UI observe changes to it.

  • Distribute responsibilities, add a domain layer if needed.

  • Add a data repository as the single-point entry to your data.

  • Expose information about the state of your data using a wrapper or another LiveData.

  • Consider edge cases, leaks and how long-running operations can affect the instances in your architecture.

  • Don’t put logic in the ViewModel that is critical to saving clean state or related to data. Any call you make from a ViewModel can be the last one.

    mvvm

- Built With 🛠

  • Kotlin - First class and official programming language for Android development.
  • Rx-Java - For composing asynchronous and event-based programs by using observable sequences.
  • Android Architecture Components - Collection of libraries that help you design robust, testable, and maintainable apps.
  • LiveData - Data objects that notify views when the underlying database changes.
  • ViewModel - Stores UI-related data that isn't destroyed on UI changes.
  • Dagger - Hilt - Dependency Injection Framework
  • Retrofit - A type-safe HTTP client for Android and Java.
  • OkHttp - HTTP client that's efficient by default: HTTP/2 support allows all requests to the same host to share a socket
  • Glide - image loading framework for Android
  • Gson - used to convert Java Objects into their JSON representation and vice versa.
  • View Binding - allows you to bind UI components in your layouts to data sources in your app using a declarative format rather than programmatically.
  • Lifecycle - perform actions in response to a change in the lifecycle status of another component, such as activities and fragments.
  • LiveData - lifecycle-aware, meaning it respects the lifecycle of other app components, such as activities, fragments, or services.
  • Navigation - helps you implement navigation, from simple button clicks to more complex patterns, such as app bars and the navigation drawer.

Android 3 Layers Architecture

https://fernandocejas.com/2018/05/07/architecting-android-reloaded/

----------------------------------------------------------------------------------------------

UI Layer: MVVM

https://fernandocejas.com/2018/05/07/architecting-android-reloaded/

----------------------------------------------------------------------------------------------

Data Layer: Repository

https://fernandocejas.com/2018/05/07/architecting-android-reloaded/

- Modules of App

App

It uses the all the components and class releated to Android Framework. It gets the data from presentation layer and shows on UI.

BuildSrc

This module helps to list and manage all the dependencies of the app at one place. It has list of dependencies and versions of that dependencies.

Data

The Data layer is our access point to external data layers and is used to fetch data from multiple sources (the cache and remote in our case).

Domain

The domain layer responsibility is to simply contain the UseCase instance used to retrieve data from the Data layer and pass it onto the Presentation layer.

mvvm