‫Hello, my friends, and welcome back.
‫In this video, we will learn how to use retrofit, how to fetch the Json format from the server into
‫Kotlin objects and display them into our application.
‫So there are three steps to use retrofit library.
‫I want from you to write them down and memorize them well, because we are going to work with the next
‫complex.
‫Applications using the retrofit.
‫We need data classes, we need service interface and we need retrofit interface instance.
‫So these are the three steps data classes, service interface and retrofit instance.
‫What are these sections and these steps?
‫The data classes.
‫The Pojo.
‫Plain object or plain old Java objects?
‫These are used.
‫For fetching response.
‫We need to create the pojo classes that automatically parse the Json data using Json in background,
‫and the Json is the converter that we've added its dependency before.
‫We just need to create this Pojo class for creating Pojo class.
‫There are several methods that we can use either manually by making every every object in the Json or
‫the Json format, we can create a class similar to it in Kotlin.
‫The other best and faster method is using the Json schema.pojo.org.
‫And there are a lot of websites that that deliver and provide this utility.
‫Transforming the Json schema to pojo.
‫Also, there is a plugin in Android studio that transform the Json schema to Pojo.
‫The data classes.
‫We are used to serialize Json and for that we need a converter.
‫And by the way, the Json Json converter is used and widely used in many projects around the world and
‫it's most popular converter.
‫The API.
‫The second step that we're going to create in retrofit is the API or service interface.
‫We need to create an interface to define our different methods that will be used for network transactions.
‫The third.
‫Step that we're going to use is the retrofit instance since we are using retrofit for network calls.
‫Let's create a class that provides us the instance of the retrofit and it should be a singleton.
‫So we will talk about these three steps in details step by step in order to master, retrofit and understand
‫every single step, every single concept in later projects.
‫So I want from you to focus with me because these are very sensitive and very.
‫Important lessons and concepts to understand.
‫So in order to use retrofit and we need to create three things the data classes, the API service or
‫the service interfaces and the retrofit retrofit instance.