/RetrofitAndRoomSample

A simple implementation of Android "Architecture Components" sample explained by Google : https://developer.android.com/topic/libraries/architecture/guide.html

Android Basic Retrofit and Room Sample

This is a simple implementation of Android Architecture Components: https://developer.android.com/topic/libraries/architecture/guide.html
It is based on the one of Philippe Boisney: https://github.com/PhilippeBoisney/GithubArchitectureComponents although my approach is simpler without using Dagger nor ButterKnife.

Getting Started

This simple app has onle one screen. When it starts, it will fetch photos of a given album from the API https://jsonplaceholder.typicode.com/photos and it will save this info into a database. The photos are shown in a RecyclerView. Only when the photos in the database are not fresh enough they will be downloaded again. In order to browse photos there is a Spinner to choose the album and an EditText to enter a photo title. When restarting the activity or rotating the device the screen keeps the same information.(One of the good things of using ViewModel and LiveData).

Preview

Architecture Components

This application implements the following concepts :

  • ViewModel
  • LiveData
  • Room

Libraries used

Author

Ignacio Garcia - (ignaciogarcia198@gmail.com)

Acknowledgments

Philippe Boisney https://github.com/PhilippeBoisney/