How To Add an Image To Android Studio Layout

Summarize this article with:
Your app looks empty without images. Buttons, backgrounds, icons, they all need visual assets to create a polished interface.
Learning how to add image to Android Studio is one of the first tasks every Android developer faces. The process seems simple, but the IDE offers multiple methods with different advantages.
This guide covers three approaches: Resource Manager imports, Image Asset Studio for icons, and direct copy to the drawable folder.
You will also learn how to display images using ImageView, set density qualifiers for sharp rendering across devices, and fix common import errors. Each method takes 2-5 minutes.
How to Add Image to Android Studio

Adding an image to Android Studio is the process of importing graphic files into your project’s drawable folder so they become usable resources in your app.
You need this when building user interfaces, creating app icons, or displaying visual content.
This guide covers 3 methods requiring 2-5 minutes each. Basic familiarity with Android Studio is enough to follow along.
Prerequisites
Before you start, make sure you have these ready:
- Android Studio Arctic Fox 2020.3.1 or later installed
- An existing Android project open in the IDE
- Image files in PNG, JPG, or WebP format
- File names using only lowercase a-z, 0-9, and underscore characters
Time needed: 2-5 minutes per method.
Skill level: Beginner.
Method One: Using Resource Manager
The Resource Manager provides the cleanest way to import drawables into your project. It handles density qualifiers automatically and shows visual previews of all your assets.
Step One: How Do You Open the Resource Manager Window?
Click View > Tool Windows > Resource Manager in the top menu. The Resource Manager tab appears on the left side of your IDE, displaying all current project resources.
Action
- Top menu: View > Tool Windows > Resource Manager
- Alternative: Click the Resource Manager tab if already visible
- Result: Panel opens showing Drawable, Color, and other resource tabs
Purpose: This window centralizes all visual assets for your Android development workflow.
Step Two: How Do You Import Images Through the Resource Manager?
Click the plus icon (+) in the Resource Manager, then select Import Drawables. A file browser opens where you select your image files.
Action
- Click: Plus icon (+) > Import Drawables
- Navigate: Select PNG, JPG, or WebP files from your computer
- Result: Import dialog appears with image previews
Purpose: Batch importing saves time when adding multiple bitmap files at once.
Step Three: How Do You Set Density Qualifiers for the Image?
In the Import Drawables dialog, select Density from the Qualifier Type dropdown. Choose the appropriate screen density value like mdpi, hdpi, xhdpi, or nodpi.
Action
- Qualifier Type dropdown: Select “Density”
- Value dropdown: Choose mdpi, hdpi, xhdpi, xxhdpi, or No Density
- Result: Image gets placed in the correct density-qualified folder
Purpose: Density qualifiers ensure sharp images across different screen density devices.
Step Four: How Do You Confirm the Image Import Is Complete?
Click Next, review the summary, then click Import. Your image appears in the Drawable tab of the Resource Manager with a generated resource ID.
Action
- Click: Next > Import
- Check: Drawable tab shows new image thumbnail
- Verify: app > res > drawable contains the file in Project view
Purpose: Confirming the import prevents missing resource errors during build.
Method Two: Using Image Asset Studio
Image Asset Studio generates multiple density versions automatically. Best for launcher icons and action bar icons where you need consistent sizing across all screen types.
Step One: How Do You Access Image Asset in Android Studio?
Right-click the res folder, select New > Image Asset. The Image Asset Studio wizard opens with configuration options for different asset types.
Action
- Path: app > res > right-click > New > Image Asset
- Result: Configure Image Asset dialog appears
Purpose: This tool is part of the mobile application development workflow for creating production-ready icons.
Step Two: How Do You Configure the Image Asset Settings?
Select your Icon Type (Launcher Icons, Action Bar, or Notification). Choose Image as the Asset Type, then browse to select your source file.
Action
- Icon Type: Select Launcher Icons (Adaptive and Legacy)
- Asset Type: Choose Image
- Path: Browse and select your source image file
- Name: Enter a resource name (lowercase, no spaces)
Purpose: Proper configuration affects how your app icon displays on device home screens.
Step Three: How Do You Generate Multiple Density Versions?
Click Next to preview all generated sizes. The wizard shows mdpi, hdpi, xhdpi, xxhdpi, and xxxhdpi versions. Click Finish to create all density folders automatically.
Action
- Preview: Check all density versions look correct
- Click: Finish
- Result: Multiple drawable-[density] folders created with sized images
Purpose: Auto-generation eliminates manual resizing for each pixel density tier.
Method Three: Direct Copy to Drawable Folder
The fastest method for simple image imports. Copy and paste directly into the drawable folder when you do not need multiple density versions or special processing.
Step One: How Do You Navigate to the Drawable Folder Location?
In Project view, expand app > res > drawable. Right-click the drawable folder and select Show in Explorer (Windows) or Reveal in Finder (Mac).
Action
- Project view: app > res > drawable
- Right-click: Show in Explorer / Reveal in Finder
- Result: System file browser opens at drawable location
Purpose: Direct folder access lets you manage files outside the IDE when needed.
Step Two: How Do You Copy and Paste the Image File?
Copy your image file from any location. Right-click the drawable folder in Android Studio and select Paste. Accept the default settings in the dialog that appears.
Action
- Copy: Select image file, press Ctrl+C (Cmd+C on Mac)
- Paste: Right-click drawable folder > Paste, or Ctrl+V
- Dialog: Click OK to confirm file copy
Purpose: Simple paste operations work for quick prototyping and testing layouts.
Step Three: How Do You Verify the Image Appears in Android Studio?
The image should appear in the drawable folder immediately. If not visible, right-click the res folder and select Synchronize. The resource ID becomes available as R.drawable.yourimagename.
Action
- Check: Image visible under app > res > drawable
- If missing: Right-click res > Synchronize
- Reference: Use @drawable/imagename in XML or R.drawable.imagename in code
Purpose: Verification confirms the build process will recognize your new resource.
You can now open the emulator to test how your images display in the app layout.
How to Display the Image in Your Layout
After importing, you need an ImageView component to actually show the image in your app interface.
Step One: How Do You Add an ImageView Component?
Open your XML layout file and drag ImageView from the Palette onto the design surface. The component appears in your layout hierarchy ready for configuration.
Action
- Open: res > layout > activitymain.xml (or your target layout)
- Palette: Locate ImageView under “Common” or “Widgets”
- Drag: Drop onto layout where you want the image displayed
- Result: ImageView element added to Component Tree
Purpose: ImageView is the standard widget for displaying bitmap files and vector drawables in Android UI/UX design.
Step Two: How Do You Set the Image Source in XML?
Select the ImageView, find the src attribute in the Attributes panel, and choose your drawable. You can also set it directly in XML code using android:src=”@drawable/yourimage”.
Action
- Attributes panel: Find srcCompat or src
- Click: Browse button (three dots)
- Select: Your image from the drawable list
- Alternative XML:
android:src="@drawable/imagename"
Add a content description for accessibility: android:contentDescription="Description of image"
Purpose: The source attribute connects your imported resource to the visible UI element.
Verification
Confirm your images work correctly before moving to building the APK.
How to Confirm the Process Worked
- Check drawable folder: All images visible under app > res > drawable
- Verify resource IDs: R.drawable.imagename autocompletes in Java/Kotlin files
- Preview layout: Image displays correctly in the Layout Editor design view
- Run on device: Test on emulator or connect your phone via USB to verify rendering
- Check build: Project compiles without resource errors
If the layout preview shows a broken image icon, the resource path or file name contains an error.
Troubleshooting
Issue: Image Not Showing in Drawable Folder After Paste
The IDE sometimes delays updating the project structure display after file operations.
Solution
- Right-click res folder > Synchronize
- If still missing: File > Invalidate Caches / Restart > Invalidate and Restart
- Check file location: Confirm image is in app/src/main/res/drawable/ on disk
Issue: Invalid Resource Name Error
Android resource names have strict naming conventions that reject certain characters.
Solution
- Use only: lowercase letters (a-z), numbers (0-9), underscore ()
- Cannot start with: Numbers
- Cannot contain: Uppercase letters, hyphens, spaces, special characters
- Rename: my-image.png becomes myimage.png
Issue: Image Appears Blurry on High-Density Screens
Single-density images get scaled up on hdpi, xhdpi, and xxhdpi devices, causing pixelation.
Solution
Provide density-specific versions in qualified folders:
- drawable-mdpi: 1x baseline (48×48 for icons)
- drawable-hdpi: 1.5x scale (72×72)
- drawable-xhdpi: 2x scale (96×96)
- drawable-xxhdpi: 3x scale (144×144)
- drawable-xxxhdpi: 4x scale (192×192)
Use Image Asset Studio to generate all sizes automatically from one high-resolution source.
Issue: Out of Memory Error with Large Images
Loading uncompressed bitmap files larger than device memory causes crashes.
Solution
- Resize images to actual display dimensions before importing
- Use WebP format for 25-35% smaller file sizes
- Consider image loading libraries like Glide or Picasso for large images
- Check APK size impact in Build > Analyze APK
Issue: Gradle Sync Failed After Adding Images
Resource compilation errors can break the entire build process.
Solution
- Check error message for specific file name causing the issue
- Verify file naming follows conventions (no uppercase, no hyphens)
- Try: File > Sync Project with Gradle Files
- Clean project: Build > Clean Project, then Build > Rebuild Project
Related Processes
Continue building your Android app with these related guides:
- How to change button color in Android Studio
- How to rename Android Studio project
- How to use Android Studio
- How to update Android Studio
For broader context on building mobile apps, explore Material Design principles and mobile app best practices.
FAQ on How To Add Image To Android Studio
What image formats does Android Studio support?
Android Studio supports PNG, JPG, GIF, WebP, and SVG formats. PNG works best for icons and images with transparency. WebP offers superior compression with smaller file sizes. SVG files require conversion to vector drawables using Vector Asset Studio.
Where is the drawable folder located in Android Studio?
The drawable folder is located at app > res > drawable in the Project view. Switch from Android view to Project view if you cannot find it. This folder stores all bitmap files and XML drawable resources for your app.
Why is my image not showing after adding it to the drawable folder?
The IDE needs to sync with file system changes. Right-click the res folder and select Synchronize. If still missing, try File > Invalidate Caches / Restart. Check that your file name uses only lowercase letters, numbers, and underscores.
How do I add images for different screen densities?
Create density-qualified folders: drawable-mdpi, drawable-hdpi, drawable-xhdpi, drawable-xxhdpi. Place appropriately sized images in each folder. Use Image Asset Studio to generate all density versions automatically from one high-resolution source file.
Can I drag and drop images directly into Android Studio?
Yes. Drag images directly onto the Resource Manager window. The Import Drawables dialog opens automatically. You can also drag images onto the drawable folder in Project view. Both methods copy files into your project structure.
What naming rules apply to drawable images?
Resource names must use lowercase a-z, numbers 0-9, and underscores only. Names cannot start with numbers. Hyphens, spaces, and uppercase letters cause build errors. Rename my-image.png to myimage.png before importing.
How do I display an added image in my app layout?
Add an ImageView component to your XML layout. Set the android:src attribute to @drawable/yourimagename. You can also use app:srcCompat for better vector drawable support. The image renders in both the layout preview and on devices.
What is the difference between drawable and mipmap folders?
The mipmap folder stores launcher icons only. These icons may display at different sizes than the device density suggests. The drawable folder stores all other images including backgrounds, buttons, and in-app graphics.
How do I reduce image file size in Android Studio?
Convert PNG and JPG files to WebP format for 25-35% size reduction. Use Build > Analyze APK to check image sizes. Remove unused density versions. Consider vector drawables for simple graphics since they scale without quality loss.
Can I add images programmatically in Java or Kotlin code?
Yes. Reference images using R.drawable.imagename in your code. Set an ImageView source with imageView.setImageResource(R.drawable.imagename). For Kotlin-based Android apps, use the same resource ID system with simplified syntax.
Conclusion
You now know how to add image to Android Studio using three different methods. Pick the one that fits your workflow.
Resource Manager works best for batch imports. Image Asset Studio handles launcher icons and generates all screen density versions automatically. Direct copy to the res folder is fastest for quick tests.
Remember the naming rules: lowercase letters, numbers, underscores only. No hyphens, no spaces.
Use WebP format when possible to reduce APK size without losing quality. Provide multiple density versions for sharp rendering on hdpi, xhdpi, and xxhdpi devices.
With your images properly imported, you can build complete layouts using XML and ImageView components. Your codebase stays organized, and your app looks professional across all Android devices.
- React UI Component Libraries Worth Exploring - February 10, 2026
- The Communication Gap That Kills Outsourcing Efficiency - February 10, 2026
- React Testing Libraries Every Dev Should Know - February 9, 2026







