Skip to content

A repository about how new architecture component can be implemented.

Notifications You must be signed in to change notification settings

dhananjay-91/architecture-component-mvp

 
 

Repository files navigation

Android Archiecture Components

A sample code contains a way how Android Architecture Components can be implemented.

The repo contains following components:

  • LifeCycle Components
    A smart component that is tightly bound to the liefecycle of other component such as an Activity or a Fragment. This helps you to produce well-organized, light weight code that is easier to maintain.
    Using LifeCycle Component, you can write lifecycle dependent code outside of lifecycle methods, such as onStart(), onPause, onResume etc.

  • Room Persistence Library
    Its a wrapper over SQLite, that allows you to communicate with database like a champ. This is why Room is recommended:-

    • Room validate queries at compile time, So - No runtime failure.
    • Room overlaps some raw SQL queries, So - Not much lengthy boring queries.
      This is how query looks like -
      @Insert
      void insertAll(User... users);
      
    • Room defines thread containts to avoid drasting effects on App performance.

Simple Setup

Gradle dependencies:

// LifeCycle components
implementation "android.arch.lifecycle:extensions:$arch_viewmodel_ver"
annotationProcessor "android.arch.lifecycle:compiler:$arch_viewmodel_ver"
// Room
implementation "android.arch.persistence.room:runtime:$arch_viewmodel_ver"
annotationProcessor "android.arch.persistence.room:compiler:$arch_viewmodel_ver"

About

A repository about how new architecture component can be implemented.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%