/Android RecyclerView Tutorial || Json Parsing using Retrofit PART 3

Android RecyclerView Tutorial || Json Parsing using Retrofit PART 3

Video: Android RecyclerView Tutorial || Json Parsing using Retrofit PART 3

Subtitles

Now we can run the project, you can see that the app has crashed, we will now check the logcat to see what were the errors, you can see here that missing internet permission. So we'll need to add the internet permission in the AndroidManifest.xml file. Now that we have added the internet permission in the Android manifest file you can run the project again. We can see the success message right over here. So the app has successfully run and the response was hopefully passed. Now we'll need to see the JSON array response into an ArrayList .

So create an ArrayList, the type of the ArrayList can be made as CarsModel now go inside the onResponse() method in the retrofit callbacks Now save the responses that we get from the network call into the array list that we just created Now we can add a breakpoint in the onResponse() method and then again run the project in debug mode so that we can catch the responses right away click OK now we can see that the breakpoint has landed on the breakpoints that we have set on cars model ArrayList. Skip this step, now we have the CarsModel, we can see that the size of the arraylist carsModels is now 6 and all the JSON array contents has been successfully passed into the ArrayList now we'll see how to pass this array list into a recycler.

READ  How Oldschool Sound/Music worked