From the course: Android Development Essential Training: Manage Data with Kotlin

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Display images dynamically with Glide

Display images dynamically with Glide

From the course: Android Development Essential Training: Manage Data with Kotlin

Start my 1-month free trial

Display images dynamically with Glide

- [Instructor] so far my application is acquiring data from a web service and then displaying some of the properties of the service using a text view and another widget, a rating bar. Now I want to display images. My images are stored on the website under the images directory. I mentioned previously that they all have the file extension webp. My first step will be to define the location of each of the images, and I'll do this in my monster.kt file. I'm going to add some new properties to this file, but I'll place them within the code block, and they'll have explicit git or functions that calculate the location or the URL of the two types of images, the main image and the thumbnail. I'll start by creating a property called imageUrl and then on the next line I'll let a get function, and I'll sign it like this. I'll start with a base URL for all the images are stored. That's the images directory. Now, I want to use this over and over again so I'm going to set it up as a constant, and…

Contents