Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android : automate SVG import [closed]

We have a legacy Android project using drawables in the respective drawable folders for mdpi, hdpi, etc., We are planning to remove the PNG files and transition to SVG. The SVG Import UI described here creates the drawables xml from the svg. Is there a way to run this tool from command line so that we can automate the conversion from SVG to Android Drawable.xml format. We have a lot of files, so doing it manually is tedious. (Alternatively, if this is not possible, I will be writing a script to convert from SVG to Android Drawable.xml format. If such a tool already exists it will be very helpful.)

Thanks.

like image 822
vine'th Avatar asked Dec 02 '22 14:12

vine'th


1 Answers

The converter code from Android Studio can be found here:

SVG2Vector.java

It should be fairly easy to extract it and turn it into a command line utility.

like image 122
Paul LeBeau Avatar answered Dec 06 '22 12:12

Paul LeBeau