GithubHelp home page GithubHelp logo

faiyyazs / shiftweather Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 5.0 539 KB

A simple android weather application to demonstrate the usage for MVVM design pattern using LiveData, RxJava, View-DataBinding, Retrofit, Moshi, Koin (Dependency Injection), based on Clean Architecture & Gradle Dependency Management (GDM) . The application supports caching using retrofits default caching mechanism.

PureBasic 9.64% Kotlin 90.36%
weather-app mvvm clean-architecture kotlin dependency-injection livedata rxjava2 viewbinding

shiftweather's Introduction

Shift Weather

About App

A simple android weather application to demonstrate the usage for MVVM design pattern using LiveData, RxJava, View-DataBinding, Retrofit, Moshi, Koin (Dependency Injection), based on Clean Architecture & Gradle Dependency Management (GDM) . The application supports caching using retrofits default caching mechanism.

The application uses the Weather API for Estonia and shows weather forecast with respect to 4 day forecast. It presents weather information for day & night with respected to the date selected and also for multiple cities in Estonia.

Components Used

  • MVVM Architecture - Robust, testable, and maintainable app with classes for managing your UI component lifecycle and handling data persistence.
  • Clean Architecture - Isolates UI, business logic and data sources' responsibilities creating a Testable system
  • KOIN - A pragmatic lightweight dependency injection framework for Kotlin
  • AndroidX - AndroidX is a major improvement to the original Android [Support Library]
  • Lifecycles - Create a UI that automatically responds to lifecycle events.
  • LiveData - Build data objects that notify views when the underlying database changes.
  • ViewModel - Store UI-related data that isn't destroyed on app rotations. Easily schedule asynchronous tasks for optimal execution.
  • Test - An Android testing framework for unit and runtime UI tests.

Screenshots

drawingdrawingdrawing

Data Flow

Let’s start explaining Data Flow in Clean Architecture as follows,

  1. UI calls method from ViewModel.
  2. ViewModel executes Use case.
  3. Use case combines data from Multiple Repositories.
  4. Each Repository returns data from a Data Source (Cached or Remote). [ In current scope only Remote ]
  5. Information flows back to the UI where we display the list of requested information.

Clean Architecture

In Clean Architecture adopted, relationship that exists between the different layers is very crucial.

Different layers & their boundaries are explained below,

Presentation Layer contains UI (Activities & Fragments)_ that are coordinated by ViewModels which execute one or more Use cases._ Presentation layer depends on Domain Layer.

Domain Layer It contains Entities, Use cases & Repository Interfaces. Use cases combine data from one or more Repository Interfaces.

Data Layer contains Repository Implementations and one or more Data Sources. Repositories are responsible to coordinate data from the different Data Sources. Data Layer depends on Domain Layer.

Clean Architecture helps Isolates UI, business logic and data sources' responsibilities creating a Testable system.

Support

If you've found an error in this sample, please file an issue: https://github.com/faiyyazs/ShiftWeather/issues

Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub.

shiftweather's People

Contributors

faiyyazs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.