Homework 03 : Movie Database

In this homework, you will create an app that allows users to see a list of currently playing movies and display details about each movie. The app will make calls out to a public web API of movie data

Before you get started:

It is essential to understand the material in these tutorials.
* ViewModel CodeLab
* Navigation CodeLab
* LiveData CodeLab
* Android Room with a View CodeLab
* Make sure you have completed and understand any issues you had with Tutorial 04 and Challenge04.


In this assignment, you will build a minimalistic movie database. This app will use the Model-View-ModelView design pattern, where we will be reaching out across the internet with a coroutine to gather data from a public movie database, and then storing that data locally in a Room database on the device

You will be pulling the information about the currently playing movies from The Movie Database. The Movie Database publishes a public web API that is free to use. In order to access the data, you must register as a developer and retrieve an access token. See https://developers.themoviedb.org/3 for instructions for getting access. Next, you should test the access token and make sure you can retrieve a list of currently movies via the following link https://developers.themoviedb.org/3/movies/get-now-playing . The developer website allows you perform such tests directly on the page. You should be able to produce JSONs like this:

{
   "vote_count":902,
   "id":166426,
   "video":false,
   "vote_average":6.5,
   "title":"Pirates of the Caribbean: Dead Men Tell No Tales",
   "popularity":213.468872,
   "poster_path":"\/xbpSDU3p7YUGlu9Mr6Egg2Vweto.jpg",
   "original_language":"en",
   "original_title":"Pirates of the Caribbean: Dead Men Tell No Tales",
   "genre_ids":[
      28,
      12,
      35,
      14
   ],
   "backdrop_path":"\/3DVKG54lqYbdh8RNylXeCf4MBPw.jpg",
   "adult":false,
   "overview":"Captain Jack Sparrow searches for the trident of Poseidon while being pursued by an undead sea captain.",
   "release_date":"2017-05-23"
}

Note that there will be multiple pages worth of movies. You will need to only display 3 pages. You can pick any three pages (it doesn’t have to be the first three).

Hint

To test if your app is loading the data from the local Room database correctly:
1. With the app connected to the internet, start the app and have it refresh from the movie database.
2. Now that you have data, turn off the internet in your emulator or device,
3. Rotate your device (virtual or physical). If the data is still there, then you know it loaded it from the Room database.