Skip to content

kaushiknsanji/View_Model_Course_Brandon_Gogetap

Repository files navigation

Android Architecture Components - ViewModels Course

Tutorial application for the course about ViewModels in Android by Brandon Gogetap.


What one will learn

  • Use of ViewModels.
  • Use of LiveData to reactively update the UI.
  • Decoupling Networking logic from the UI using ViewModels and LiveData.
  • REST API Calls using Retrofit to download the Remote data in ViewModels.
  • Dagger2 dependency injection for ViewModels.
  • AutoValue to define immutable Value Types.

Required Libraries/Dependencies

  • Android Support library
  • ViewModel for maintaining the data of the App and handling the network queries.
  • LiveData to hold the data and notify its observers when the data changes.
  • Butterknife for binding the View components.
  • Retrofit for communicating with GitHub API.
  • Moshi to parse JSON into Java Objects.
  • Dagger2 for Dependency Injection.
  • AutoValue for defining immutable Value Types.
  • Interdepencies of "Retrofit & Moshi", and "AutoValue & Moshi".

Branches in this Repository

  • feat_viewmodels
    • Covers the initial setup and implementation of ViewModels to load and display a list of Repositories and the details for a selected Repository.
    • Shows how to reload the app after process death (save-restore flow).
  • feat_dagger
    • Covers the implementation of Dependency Injection using Dagger 2 for Networking logic and ViewModels.
  • feat_autovalue
    • Covers the AutoValue Implementation for Value Types.
    • Shows how using AutoValue makes comparison usecases like DiffUtil easier.
  • master
    • This is the main/default branch that covers all the above.

Udemy Certificate

Udemy Certificate