I have a large number of svg files I want to convert to xml vector assets for Android.
The documented process is, for each file, File->New->Vector Asset. Then choose the svg file, click Next then Finish.
Is there a faster way? Maybe a bash comment to launch Asset Studio?
Android Studio includes a tool called Vector Asset Studio that helps you add material icons and import Scalable Vector Graphic (SVG) and Adobe Photoshop Document (PSD) files into your project as vector drawable resources.
PathData in vector images android is Vector graphic program's script. It is not exactly clean and human readable code as a high priority.
You can import an SVG file as a VectorDrawable in Android Studio, follow these steps : "Right-click" on the res folder and select new > Vector Asset. Select the Local File option and browse to your . svg file.
The Resource Manager tool that was added in Android Studio version 3.4 can bulk import SVGs and convert them into vector drawables.
Tools
→ Resource Manager
Drawable
tab+
button in the top left cornerImport Drawables
There you can select all the files you want to import at once. More details here.
There are few Git projects which would help you achieve the bulk conversion of svg files to Vector Drawable supported by android.
Juraj Novák's : http://inloop.github.io/svg2android/
SvgToVectorDrawableConverter original repo was deleted. But you could choose one of the fork . Example: svg2vd -i "\*" -o out --fix-fill-type
For single conversion: SVG to Vector Drawable Convertor online
Use wrapper of original converter ported from Android Studio
Hope it helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With