filmov
tv
Android Kotlin Demo: Using Volley to read JSON from the Web (Harry Potter Example)

Показать описание
In this video we look an an Android app that uses Volley to read a JSON file from the Internet. We show the gradle edit that allows us to bring in the Volley code and the edits to the Android Manifest that give the app the appropriate permissions. Then we show the Kotlin code that uses Volley to make an HTTP request. Actually we show two versions. In the first we request a JSON Object, and in the second we request a JSON Array. If there is a successful response we use the data to load a spinner with the titles of Harry Potter movies. And we display information from the JSON file when the user selects a movie title using the spinner. We also had a new Intent which went over to Youtube. Two other features worthy of note are: 1) we have to say what will happen if there is an error in the response; and 2) we must put the request in the queue.