Modularizing Code

In this lesson, we cover the organizing code for better readability in detail.

We'll cover the following...

This lesson delves further into executing HTTP requests to fetch movie data and organize code for better readability.

Modularizing code

Let’s move the getJson() method in its own class, say MoviesProvider. This keeps related code together.

All images in TMDB are hosted in a common location. We’ll use the imagePathPrefix variable to hold this path in the MoviesProvider class. Since this path doesn’t change and should be accessible from other classes, it should be final and static.

The imagePathPrefix is the path to image storage. Each movie carries its own ...