OkHttp Interceptors in Android

May 25 2021 · Kotlin 1.4, Android 5, Android Studio 4.1

Part 1: Implementing OkHttp Interceptors

02. Set Up the Project

Episode complete

Play next episode

Next
About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 01. Learn about OkHttp Interceptors Next episode: 03. Setup HttpLoggingInterceptor & Debug API Calls

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Notes: 02. Set Up the Project

You must generate your own API keys to follow along with the course. Otherwise, you will not be able to fetch the movies’ data.

Transcript: 02. Set Up the Project

To get started with the starter project, you first need an API key from TheMovieDB(TMDB). To generate a new API key, you first need a TheMovieDB account.

Head over to https://www.themoviedb.org/signup and write in mock data on the Sign Up form. Once done, click Sign Up.

You will receive a verification email. Once you have successfully verified your account, header over to https://www.themoviedb.org/login and login with your credentials.

You will be redirected to your TMDB profile. Click the Profile and Settings menu items on the top right of the website and then select Settings.

From the panel on the left, select API. On the API page, navigate to the Create tab. Here, you have to choose the type of API key you want to register. For this course, select Developer. Take your time and read through the Approve Terms of Use. Once done, click Accept.

On the next page, you have to fill in the details of the app. Choose the Type of Use as Mobile Application and fill in the rest of the details. Once done, click Submit.

On the next screen, you will see a section named **API Key (v3 auth). This section contains your API key.

Copy the API key.

Open the starter project on Android Studio. Open the app module build.gradle and paste the API key as follows:

buildTypes.each {
    it.buildConfigField 'String', 'THE_MOVIE_DB_API_TOKEN', "\"your-api-key\""
}

Click Sync now. Build and run the project. You can see that the list of movies is loaded successfully.