TechBuzzPro

How to Import Material Design Icons into Android

· 5 min read · Phones & Tablets

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You can bring Material Design icons into an Android project in two main ways: use the official Material Symbols font or SVG files from Google Fonts, or use the Android Studio Vector Asset Studio to generate vector drawables from Material icon SVGs. The quickest path for most apps is Vector Asset Studio, which converts an SVG into an XML drawable you can reference like any other resource. Before you start, make sure you have Android Studio installed and a project open, and that you know which icon style (outlined, rounded, sharp, or two-tone) you want.

What You'll Need

  • Android Studio installed on your computer (any recent stable version).
  • An Android project open in Android Studio.
  • An internet connection to download icon files from Google Fonts.
  • A web browser to browse and download the icons you need.
  • Optional: a vector graphics editor if you want to customize an SVG before importing.

Step-by-Step

  1. Download the icon you want. Go to fonts.google.com/icons in your browser. Search for the icon by name (for example, “home” or “settings”). Choose the style and weight from the panel on the right. Click the icon, then choose “Download SVG” (or “Download PNG” if you only need a raster image, though SVG is better for Android). Save the file somewhere you can find it.
  2. Open Vector Asset Studio. In Android Studio, right-click the res folder in the Project view (usually under app/src/main/res). Select New > Vector Asset. The Vector Asset dialog opens. (Menu labels can differ slightly between Android Studio versions.)
  3. Choose “Local file (SVG, PSD)”. In the dialog, select the “Local file” option. Click the folder icon next to the “Path” field and browse to the SVG file you downloaded. Android Studio previews the icon on the right.
  4. Name the asset. In the “Name” field, enter a resource name using lowercase letters, numbers, and underscores only (for example, ic_home). This name becomes the drawable resource ID. Avoid spaces and uppercase letters.
  5. Adjust size and colors if needed. You can set the “Size” and “Opacity” fields. For most icons, leave the default size (24dp) and opacity at 100%. If your SVG uses multiple colors, Vector Asset Studio may flatten them; check the preview to confirm the icon looks right.
  6. Click Next, then Finish. Android Studio generates an XML vector drawable in the res/drawable folder. The icon is now part of your project.
  7. Reference the icon in your layout or code. In an XML layout, use android:src="@drawable/ic_home" on an ImageView, or set it as a drawableStart on a TextView. In Kotlin or Java, use R.drawable.ic_home with your image-loading or view-binding code.
  8. Optional: use the Material Symbols font instead. If you prefer a font-based approach, download the Material Symbols font files from Google Fonts, add them to res/font, and use a TextView with the appropriate Unicode code point. This is less common for individual icons but useful for large sets.

Common Mistakes

  • Using uppercase or spaces in the asset name. Android resource names must be lowercase and can contain only letters, numbers, and underscores. A name like “ic Home” will cause a build error.
  • Importing a PNG instead of an SVG. PNGs work but do not scale cleanly and increase APK size. Always prefer SVG for icons that need to scale across densities.
  • Forgetting to check the preview. Some SVGs contain features Vector Asset Studio does not support, such as certain gradients or embedded raster images. The preview shows what will actually be generated.
  • Placing the drawable in the wrong folder. Vector Asset Studio puts the XML in res/drawable. If you manually copy files, make sure they go there, not into res/layout or res/mipmap.
  • Using the wrong icon style. Material icons come in filled, outlined, rounded, sharp, and two-tone styles. Mixing styles in one app looks inconsistent. Pick one style and stick to it.

Tips

  • Use the search and filter options on fonts.google.com/icons to find icons quickly. You can filter by style, weight, and grade.
  • Keep a consistent icon size. Material icons are designed on a 24dp grid; scaling them to other sizes can blur the design intent.
  • If you need many icons, consider downloading the entire Material Symbols font and using it as a font resource, or use a library like the Material Icons library if your project already includes it.
  • Name icons with a prefix like ic_ (for example, ic_search) to keep them organized and easy to find in autocomplete.
  • Check the license: Material icons are available under the Apache License 2.0, which allows free use in commercial apps. Keep the license file if you redistribute the icons.

Troubleshooting

If the icon does not appear after import, first confirm the XML file exists in res/drawable and that the name matches exactly what you reference. Clean and rebuild the project (Build > Clean Project, then Build > Rebuild Project). If the preview in Vector Asset Studio looked wrong, try simplifying the SVG in a vector editor or download a different icon variant. If Android Studio shows an error about unsupported SVG features, open the SVG in a text editor and remove elements like <image> or complex filters, or use a simpler icon. If the icon appears but is the wrong color, check whether the SVG uses a hard-coded fill color; you can edit the generated XML to change android:fillColor. For font-based icons, verify the font file is in res/font and that you are using the correct Unicode code point.

Frequently Asked Questions

Can I use Material icons without Android Studio?

Yes. You can download SVGs and convert them to vector drawables manually, but Android Studio's Vector Asset Studio is the easiest and most reliable method. Manual conversion requires understanding the vector drawable XML format.

Do I need to add a dependency for Material icons?

No. Importing SVG icons via Vector Asset Studio does not require any additional library. If you use the Material Components library, it includes some icons, but not the full set.

What is the difference between Material Icons and Material Symbols?

Material Icons is the older set; Material Symbols is the newer, variable font set with more styles and weights. Both work in Android, but Material Symbols offers more flexibility.

Can I change the color of an imported icon?

Yes. In the generated XML, change the android:fillColor attribute, or use android:tint on the ImageView that displays it. Tinting is often easier for theme-aware colors.

Why does my icon look pixelated?

Vector drawables scale without pixelation. If the icon looks pixelated, you may be using a PNG instead of an SVG, or the SVG itself contains raster elements. Re-download the icon as a pure vector SVG.

Is it legal to use Material icons in a commercial app?

Yes. Material icons are released under the Apache License 2.0, which permits commercial use. You should include the license notice as required by the license.