Giter Site home page Giter Site logo

aksx73 / quotesstream Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 1.96 MB

❝Quotes❞ android application built to demonstrate Pagination using Jetpack Paging library with Remote Mediator following MVVM architecture.

Home Page: https://aksx73.github.io/QuotesStream/

Kotlin 100.00%
android figma figmadesign kotlin kotlin-coroutines mvvm-android openapi paging3 remotemediator retrofit2 room-database flow hilt-android livedata-viewmodel viewbinding

quotesstream's Introduction

Surface-Pro-8-2-1.png

Quotes Stream

Quotes application built to demonstrate Pagination using Jetpack Paging library with Remote Mediator following MVVM architecture

Download and test latest version 👇

QuotesStream

About

App loads quotes from open source quotations API Quotable. Uses Paging 3 library for pagination with RemoteMediator for offline support.
A RemoteMediator implementation helps load paged data from the network into the database, but doesn't load data directly into the UI. Instead, the app uses the database as the source of truth.

App follows clean architecture pattern (MVVM). Whole app is organized with intent to create architecture like in multi-module approach.

Tech stack 🛠

  • Kotlin - First class and official programming language for Android development.
  • Coroutines - A coroutine is a concurrency design pattern that you can use on Android to simplify code that executes asynchronously.
  • Flow - A flow is an asynchronous version of a Sequence, a type of collection whose values are lazily produced.
  • Android Jetpack - A suite of libraries to help developers follow best practices, reduce boilerplate code.
    • LiveData - Data objects that notify views when the underlying database changes.
    • ViewModel - Stores UI-related data that isn't destroyed on UI changes.
    • ViewBinding - Generates a binding class for each XML layout file present in that module and allows you to more easily write code that interacts with views.
    • Room - SQLite object mapping library.
    • Paging 3 - Paging library helps you load and display pages of data from a larger dataset from local storage or over network.
    • DataStore - Jetpack DataStore is a data storage solution that allows you to store key-value pairs or typed objects with protocol buffers. DataStore uses Kotlin coroutines and Flow to store data asynchronously, consistently, and transactionally
  • Dependency Injection -
    • Hilt-Dagger - Standard library to incorporate Dagger dependency injection into an Android application.
    • Hilt-ViewModel - DI for injecting ViewModel.
  • Retrofit - A type-safe HTTP client for Android and Java.
  • Figma - Figma is a browser-based UI and UX design application, with excellent design, prototyping, and code options.

Package Structure

# Root Package
|
├── data                # For data handling.
│   ├── local           # Local Persistence Database. Room (SQLite) database
|   │   ├── dao         # Data Access Object for Room   
|   |   |── database    # Datbase Instance
|   |── remote          # Remote Data Handlers
|   |   ├── dto         # Model class from api response
│   |   ├── api         # Retrofit API for remote end point
|   |── mapper          # Mapper class to map dto object to required object 
|   |── paging          # Remote mediator class
|   |── preference      # Datastore manager class
|   └── repository      # Repository implementation
|
├── domain              # Responsible for business logic
|   └── repository      # Repository interface (Single source of data)
|
├── di                  # Dependency injection modules 
|
├── model               # Model/entity classes
|
├── ui                  # Presentation layer
│   |── App             # Application class
|   ├── MainActivity    # Main activity
|   ├── viewmodel       # Common viewmodel for all data
|   ├── quote           # Fragment + PagingDataAdapter + Loader adapter for quotes list
|   ├── favorite        # Fragment + adapter for favorite quotes
|   └── detail          # Fragment for detail view of a single quote
|
└── utils               # Utility classes

Architecture

This app uses MVVM (Model View View-Model) architecture and uses RemoteMediator to get page from network and database.

mvvm-pagingination-remotemediator.jpg

MAD Score

Summary

quotesstream's People

Contributors

aksx73 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

abufawwaz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.