How to use the material icon distributed by Google on Android Studio

Asked 1 months ago, Updated 1 months ago, 7 views

I wanted to use the icons distributed by Google.
However, I am at a loss how to import to Android Studio.

Where and how can I put the downloaded items from this site?

This may be a rudimentary question, but I look forward to hearing from you.

android android-studio

2022-09-30 11:29

2 Answers

In recent Android Studio, there are no drawable folders such as res/drawable-hdpi in the project template, so please create one by one...

2022-09-30 11:29

(project root)/app/src/main/res/drawable

It is basic to put it on the .

If you want to use PNG(JPG,GIF) files differently depending on the screen density (dpi) of the device, besides the default drawable, drawable-mdpi, , drawable-hdpi, ,

I believe that each drawable-XXX is under the Android folder of the downloaded file, so I will copy the PNG you need into the same drawable-XXX on the project side.If it doesn't bother you, I think you can move everything, but even if you copy at least one copy, Android will automatically zoom in and out, so you can use it for now.

By the way, since 5.0 (API-21) you can also use the vector data icon, so if it's a vector, it's ok to place only one PNG file in the default drawable without having to prepare a PNG file for each screen density.You can convert it from SVG and use it.→Reference site

2022-09-30 11:29

If you have any answers or tips

© 2022 OneMinuteCode. All rights reserved.