Git Product home page Git Product logo

android-mvvm's Introduction

Android MVVM Base Architecture for Enterprise Mobile Application using Architectural Components

Highlights

  1. MVVM Architectural pattern
  2. Offline Support
  3. Unit test demonstration using JUnit and Mockito
  4. UI unit test demonstartion using Espresso
  5. Gradle scripts for running sonarqube static code analysis, code coverage, etc.

The application has been built with offline support. It has been designed using Android Architecture components with Room for offline data caching. The application is built in such a way that whenvever there is a service call, the result will be stored in local database.

The whole application is built based on the MVVM architectural pattern.

Application Architecture

alt text

The main advatage of using MVVM, there is no two way dependency between ViewModel and Model unlike MVP. Here the view can observe the datachanges in the viewmodel as we are using LiveData which is lifecycle aware. The viewmodel to view communication is achieved through observer pattern (basically observing the state changes of the data in the viewmodel).

Screenshots

Home

Home

Home

Programming Practices Followed

a) Android Architectural Components
b) Dagger 2 for Dependency Injection
c) MVVM
d) Retrofit with Okhttp
e) Room for data caching
f) JUnit and Mockito for Unit testing
d) Repository pattern
e) JSoup for HTML Parsing

How to build ?

Open terminal and type the below command to generate debug build

./gradlew assembleDebug

Open terminal and type the below command to generate release build

./gradlew assembleRelease

How to generate Sonarqube report ?

Open gradle.properties and update the below line with the sonarqube server url

systemProp.sonar.host.url=http://localhost:9000

Before running the sonarqube job, make sure the project version has been updated in the build.gradle. On every run, increment the version by 1.

            property "sonar.sources", "src/main"
            property "sonar.projectName", "NYTimesApp" // Name of your project
            property "sonar.projectVersion", "1.0.0" // Version of your project
            property "sonar.projectDescription", "NYTimes Application to list popular Articles"

For running the sonarqube job, type the below command in the terminal.

./gradlew sonarqube assembleDebug


How to generate code coverage report ?

Open terminal and type the following command

./gradlew clean jacocoTestReport

The coverage report will be generated on the following path.

app/build/reports

android-mvvm's People

Contributors

lajesh avatar

Stargazers

 avatar

Watchers

 avatar  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.