GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aftabsikander/MobilityDemo: MVVM kotlin project

BranchesTags
Open more actions menu

Latest commit

 

History

34 Commits
34 Commits

Folders and files

NameName
Last commit message
Last commit date
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
key
key
 
 
res
res
 
 
screenshots
screenshots
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
SKILL_TEST.en.md
SKILL_TEST.en.md
 
 
SKILL_TEST.ja.md
SKILL_TEST.ja.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
mercari.release.signing.properties
mercari.release.signing.properties
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

Dynamics Mobility App Code Setup

Android Studio IDE

Version 3.4.1 of Android Studio IDE was used for developing the Mobility Dynamics App

Project Configurations

  • Gradle Version: 5.1.1
  • Gradle Build Tool Version: 3.4.1
  • Koltin Version: 1.3.31
  • Build Tool Version: 28.0.3
  • Minimum SDK Version: API 21

Android MVVM Base Architecture

This application is build using MVVM architecture having Repository Design Pattern for data source. Following are key highlights of the project.

  • MVVM Architectural pattern
  • Offline Support using Realm
  • Dependency Injection using Dagger 2 with Dagger-android
  • Android Jetpack libraries
    • ViewModel
  • Paging Library
  • LiveData
  • Data Binding Library
  • Retrofit 2 for network layer
  • Glide for Image loading
  • Timber for Logging
  • Realm Monarchy A wrapper over Realm, that exposes RealmResults as various forms of LiveData.
  • Fabric.io Crashlytics for crash reporting tool.

The application has been built with offline support. It has been designed using Android Architecture components with Realm 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. If internet is not available application will display data from offline storage.

Application Architecture

MVVM

The main advantage of using MVVM, there is no two-way dependency between ViewModel and Model, unlike MVP. Here the viewer can observe the data changes 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.

Presentation Layer

The View layer is much more flexibile as an indefinite number of Views can bind to a ViewModel. Also, MVVM enforces a clear separation between Views and their master - ViewModel, as the latter holds no reference to Views. The model layer is completely isolated and centralized through the repository pattern.

Model Layer

The model layer is structured on repository pattern so that the ViewModel has no clue on the origins of the data.

The repository handles data interactions and transactions from two main data sources - local and remote which is being handled by NetworkBoundResource and NetworkPaginatedBoundResource for pagination payload data.

There are two main use-cases, online and offline. In both use cases, NetworkBoundResource or NetworkPaginatedBoundResource will always send a call to the server for fetching latest data and cache it in local database and data is displayed to the user. In case of no internet connection, data is always queried from local storage.

Model Layer

Dependency Injection

Dagger2 is used to externalize the creation of dependencies from the classes that use them. Android specific helpers are provided by Dagger-Android and the most significant advantage is that they generate a subcomponent for each Activity through a new code generator.

Dagger

Strong points

  • Decoupling level is high.
  • Data Flow is centralized through Observable.
  • Possess high flexibility to create variants for automated and manual testing.
  • Possess lightweight structure due to MVVM presentation pattern.
  • Is scalable and easy to expand.

Weak points

  • Possess high code base - simpler approaches will certainly lower code size

Different Type Of Environments

There are four build variant configured for the App, As in real application we have many environments due to this I create following build variant to support various environments as a base.

  • Prod Build Variant:

    • This build variant contains both (Debug and Release mode)
    • It contains a separate code base for web service URL.
  • UAT Build Variant:

    • This build variant contains both (Debug and Release mode)
    • It contains a separate code base for web service URL
  • QA Build Variant:

    • This build variant contains both (Debug and Release mode)
    • It contains a separate code base for web service URL.
  • Dev Build Variant:

    • This build variant contains both (Debug and Release mode)
    • It contains a separate code base for web service URL.

Build Variant

How to build ?

As we have four build variant, for generating debug/release build command varies according to product flavors. Open terminal and type the below command to generate debug or release build respectively

  • Prod Build Variant:

    • gradlew assembleProdDebug or ./gradlew assembleProdDebug
    • gradlew assembleProdRelease or ./gradlew assembleProdRelease
  • UAT Build Variant:

    • gradlew assembleUatDebug or ./gradlew assembleUatDebug
    • gradlew assembleUatRelease or ./gradlew assembleUatRelease
  • QA Build Variant:

    • gradlew assembleQaDebug or ./gradlew assembleQaDebug
    • gradlew assembleQaRelease or ./gradlew assembleQaRelease
  • Dev Build Variant:

    • gradlew assembleDevDebug or ./gradlew assembleDevDebug
    • gradlew assembleDevRelease or ./gradlew assembleDevRelease

TODO Improvements Task

  • Move to Navigation component Library after this issues is fixed
  • Improved error screen, currently I am just showing text.
  • Pull to Refresh for Display Items. We can do this once we add Pagination API.
  • Include Proguard rules for code obfuscation.
  • Include Centralize D365 Login

About

MVVM kotlin project

Topics

dagger2jetpackjetpack-androidjetpack-paginationkotlinlivedata-databindingmvvmviewmodel

Resources

Readme
Activity

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.