‫Welcome back.
‫Let's start creating our modal classes.
‫Open Android Studio and create a new project named as the Quiz App.
‫Then inside this package I'll create a new package named as modal.
‫And inside this modal I'll create the modal classes for our application.
‫I'll close all of these classes and in order to create the modal classes, you should refer to the Json
‫response here.
‫If we look closer we have an array.
‫And these objects the first object separated by comma and the second object.
‫I'll copy this whole response and I'll use an online tool called Json to Pojo.
‫Then I need to choose the package name here.
‫The package is Campmaster coding.
‫Dot the quiz app and paste it here and the class name.
‫I'll name it as question, then select Json.
‫Select Json because I'm going to use this Json converter.
‫And here I'll click on preview.
‫And this is our class.
‫Copy it.
‫And I'm going to create a new Java class.
‫I'll name it as question and I'll paste the whole response.
‫I'll copy this copy to clipboard.
‫Then I'll paste this.
‫Okay.
‫Remove this.
‫And we need to add the dependency.
‫So let's go to the Gradle build.gradle.
‫And let's add the dependencies for retrofit and the libraries that we'll use in this application.
‫Since I'm going to use mVVM architecture I need to add the lifecycle ViewModel and LiveData dependencies.
‫So for that go to Developer.android.com slash jetpack slash Android slash releases slash lifecycle.
‫Then you scroll down to get the dependencies.
‫Select Kotlin and here I'll copy this lifecycle version.
‫Paste it here and I need to use the ViewModel.
‫This is the ViewModel.
‫And I need to use the live data.
‫So copy live data.
‫And if you notice there is x, you can remove it because this is for Kotlin.
‫Later on when we move to the Kotlin section, we'll use the dash.
‫Or you can simply scroll down to select Java here the Java codes and select the view model and the live
‫data.
‫So I'll copy them and val lifecycle okay.
‫This is for Java because we're working with Java.
‫The second library that we're going to use is the retrofit.
‫This is our friend.
‫So go to square dot Github.io slash retrofit and click on download.
‫And here I need to get this dependency copy.
‫And here I'll use retrofit.
‫Then I need to get the latest version.
‫To get it I'll go to view GitHub project and select down to 92.9.0.
‫Here I'll put it like this.
‫And don't miss to add and change this dependency into this syntax.
‫I need a converter.
‫So back to our retrofit.
‫I'll go up and I'll use Json copy it implementation retrofit converter Json and 2.9.0.
‫Make sure that you get the same version for the converter and the retrofit 2.9.0 sink.
‫Now later on we'll talk about these retrofit converters.
‫Close it and you can see the problems are solved.
‫We created question option one, option two, option three, option four and correct option variables.
‫These six strings represent our modal class, our data that is fetched from the database into our application.
‫I'll remove this and annotation here.
‫I'll add dot modal class okay in order to solve because I'm going to place it or I place it.
‫The question inside the modal.