In this tutorial, we will learn how to use ImageView in Android. ImageView is really helpful widget and we use this widget to add Images in our Android App. Here we will learn how to use drawable images in ImageView. We will also learn how we can add images in ImageView using the XML layout file. So without wasting time let’s directly jump to our Examples.
Before writing any code firstly we will add an image in our project. To do this, you can copy an image from anywhere in PC and then you have to add the image in res/drawable folder of our project. While adding an image always keep it in your mind image size should be less than 1MB and image name should be in small letter.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="16dp"
android:orientation="vertical"
tools:context=".MainActivity">
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/owlbuddy"/>
</LinearLayout>
ImageView in Android Output:

Parvesh Sandila is a passionate web and Mobile app developer from Jalandhar, Punjab, who has over six years of experience. Holding a Master’s degree in Computer Applications (2017), he has also mentored over 100 students in coding. In 2019, Parvesh founded Owlbuddy.com, a platform that provides free, high-quality programming tutorials in languages like Java, Python, Kotlin, PHP, and Android. His mission is to make tech education accessible to all aspiring developers.​