Categories
Mobile Programming

Learn how to access an API in Android with Retrofit

This article is part of the Android August series, in which I’m writing an Android development-related article every day during the month of August 2021.

Mobile apps are often front ends for APIs, so one of the first things you should learn about Android programming after getting a reasonable grasp on the basics is how to access an API. If you’re at this stage, this is your lucky day: Tutorials.EU has just posted a new tutorial titled Everything You Need To Know About Retrofit in Android | Get Data from an API that shows you how to build an app that accesses the Rick and Morty API:

https://www.youtube.com/watch?v=FyqK1hbZ6Z4

There are a number of Android libraries that you can use to access APIs, including OkHttp, Volley, and the one used in this tutorial: Retrofit.

Both OkHttp and Retrofit are creations of the digital payments and financial services company Square, whose work you’ve probably encountered when buying something. Both are HTTP clients, but when it comes to accessing APIs, you want to use Retrofit, because that’s exactly what it’s for.

This video is the first in a series. This first video will cover the basics of API access with Retrofit. There’ll be a second video where you’ll clean up the app’s architecture using the MVVM pattern, and then a third video where you’ll change the implementation so that it uses coroutines to perform tasks in the background.

One reply on “Learn how to access an API in Android with Retrofit”

Comments are closed.