Skip to content

The template project that uses Android Architecture Components with Repository pattern.This app uses retrofit to perform HTTP request. This app also communicates data between two fragments using view model

Notifications You must be signed in to change notification settings

MohitGoel9456/Android-Live-Data-Dagger2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

AndroidLiveDataWithDagger2

Android app to fetch movie details for a given query

Set up api key

please create an api-key on clicking this link and add it to MovieApiService class to run the project.

Please refer to the following posts describing the code in details:

  1. Getting started with android app architecture components like LiveData and viewmodel
  2. Getting started with android app architecture components with dagger2

The app demonstrates the usage of MVVM architecture pattern using android architecture component library and LiveData and Repository pattern, inspired from Google recommended architecture pattern from I/O 17 .

ViewModel provides the data for a specific UI component, such as a fragment or activity, and handles the communication with the business part of data handling, such as calling other components to load the data or forwarding user modifications. The ViewModel does not know about the View and is not affected by configuration changes such as recreating an activity due to rotation.

LiveData is an observable data holder. It lets the components in your app observe LiveData objects for changes without creating explicit and rigid dependency paths between them. LiveData also respects the lifecycle state of your app components (activities, fragments, services) and does the right thing to prevent object leaking so that your app does not consume more memory.

Repository modules are responsible for handling data operations. They provide a clean API to the rest of the app. They know where to get the data from and what API calls to make when data is updated.

Libraries Used

  1. Android Architecture components
  2. Dagger2
  3. Retrofit2
  4. Butterknife

About

The template project that uses Android Architecture Components with Repository pattern.This app uses retrofit to perform HTTP request. This app also communicates data between two fragments using view model

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages