From the course: Android Development Essential Training: 2 User Interface Design
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution: Load a network image - Android Tutorial
From the course: Android Development Essential Training: 2 User Interface Design
Solution: Load a network image
(upbeat music) - [Instructor] Welcome back. Let's jump into my solution to the load and network image challenge. For this challenge, I wanted you to start with a sample project from the exercise files and add the needed code to support the following action. Clicking on the switch button toggles the images that are loaded from the network. This required getting to know a new library, Coil. Coil is well documented and intuitive. On the homepage of their website there's a quick start section. Since we're not looking for anything fancy yet, we can use the load extension function directly by passing in a string which contains our desired image URL. Is that what you did? I hope so. Let's move over to the app to see my solution. Here in the onCreate method of our main activity class, we'll first create an OnCheckChangeListener for the switch. We do that there on line number 17. Then inside of this listener, we'll check…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Display image resources5m 10s
-
(Locked)
Load image resources at runtime6m 16s
-
(Locked)
Reduce file size with WebP images4m 26s
-
(Locked)
Use XML-based VectorDrawable images4m 37s
-
(Locked)
Create icons in Android Studio4m 45s
-
(Locked)
Challenge: Load a network image2m 43s
-
(Locked)
Solution: Load a network image1m 48s
-
(Locked)
-
-