Although there are some online tools available which convert SVG & PSD images into android XML. But those tools don’t work for all kinds of image resources. The best way is to import SVG & PSD icons as XML Drawables into Android projects using the Vector Asset Tool provided by Android Studio. When we import our SVG and PSD images using Vector Asset Tool, it automatically converts them into XML Drawable.
To Import SVG and PSD resources into Android Studio using Vector Asset Tool, follow the below steps.
1. From your left Project pane, choose Android View, expand
app and then
2. Right Click on
drawable directory then -> New -> Vector Asset
3. After the above steps, a popup window would come from where you can choose your SVG or PSD images, choose its name, set its size and can choose the directory where you want to import the XML resource file. The following screenshots are showing the popup.
After clicking on the Finish button, Android Studio will automatically convert SVG and PSD files into XML Drawables. You can access this Drawable anywhere in your project as you access other drawables. Like
R.drawable.ic_fb or in layout files
Thats it!! This is how you can Import SVG & PSD Icons into Android Studio. 🙂
You can also find other useful helping materials and tutorials in our Coding Articles & Tutorials Knowledge Base.