Handling and Displaying Images

Learn how to display local and URL-based images in an Android application using Android ImageView and Fresco image library.

Introduction

In this lesson, we’ll learn how to handle and display images in Android apps. We’ll start with a simple example and learn how to display a static image in an activity, and then move on to more complex use cases, such as displaying images from a URI, caching images, and so on.

Displaying a static image

A static image can be displayed using an ImageView with a Drawable set as its source.

Let’s define an ImageView in the activity resource file and set its android:src to a drawable file.

Get hands-on with 1200+ tech skills courses.