This article talks about best websites to convert SVG to Vector Drawable for Android. As you may know, SVG stands for Scalable Vector Graphics. This Scalable Vector Graphics is a XML file which contains image format for 2D graphics and supports animation and interactivity. And a Vector Drawable is a XML file which has color info and vector graphic info which is shown as a set of lines, points, and curves.
Writing Vector Drawable XML resource files for an application is a very crucial part, and the whole process is very tedious and time-consuming. With these websites, you can easily generate Vector Drawable XML file from an SVG. The process is simple and only takes a few seconds. So, without further ado, let’s dive in the list.
Here Are 3 Best Websites To Convert SVG To Vector Drawable For Android:
SVG2Android is an online tool to convert SVG to Vector Drawable XML resource file. This tool is an implementation of a GitHub project which you can access here.
With this online tool, you can extract all parameters (groups and elements) from SVG file that are supported in Android. To give you a glimpse into the details, here is a list of all supported and unsupported parameters:
- Supported Elements: path, line, circle, rect, polyline, polygon, and ellipse.
- Unsupported Elements: gradients, patterns, text element and matrix transforms.
The process of conversion is very simple here. All you have to do is open your SVG file(s) and it will instantly start converting it to Vector Drawable XML. Then, it shows you all the XML data on the screen which you can copy or download as a .xml file. You can convert SVG to XML resource files in the batch mode here.
Convert your SVG to Vector Drawable here.
SVG to Vector Drawable Converter
This is another SVG to Vector Drawable converter that is an online implementation of this GitHub project. It is a batch converter where you can easily generate Android Vector Drawable XML resource files from your SVGs.
This converter does not support patterns, gradients, masks, and images but it does provide written instructions to fix your Vector Drawable if there is any error. You can access those instructions along with other information on its GitHub page.
This converter has a tool to fix file type that rebuilds the paths to avoid errors in the rendering. As per your requirements, you can convert your SVG to Vector Drawable to target any of the followings:
- Android 5.0+
- Android 7.0+
To convert your SVG(s) to Vector Drawable, first, select a target from the 4 given options. By default, it targets Android 5.0+ and uses those rules for conversion. Then, upload your SVG files to start the conversion. It will take few seconds depending on the number of SVGs you upload. After the conversion, it packs all the Vector Drawable XML files in a ZIP file which you can download on your computer.
Give this SVG to Vector Drawable Converter a try here.
ShapeShifter is a web application designed to ease the process of creating icon animations for Android, iOS, and the web. And, here you can convert SVG to Vector Drawable XML file as well.
To convert SVG to Vector Drawable XML here, go to Import -> SVG and upload your SVG file. Do note that ShapeShifter does not support batch mode for this conversion. When SVG file is loaded, ShapeShifter displays its vector graphics in the animation tab. Here, you can also select which paths you don’t want to include in the Vector Drawable. After that, click Export and select Vector Drawable to save the Vector Drawable XML file to your computer.
One additional perk of this SVG to Vector Drawable converter is that you can edit the path values of the SVG vector graphics here. You can change its name, path data, color stroke color and more. To know more about ShapeShifter, you can visit its Github page here.
Convert SVG to Vector Drawable with ShapeShifter here.
All these tools to convert SVG to Vector Drawable XML are easy to use. These tools don’t support all the elements that an SVG file can have, but that’s a limitation of Android OS, not theirs.