Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to bulk convert svg files using Android Asset Studio?

Tags:

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?

like image 485
pzulw Avatar asked Dec 16 '16 18:12

pzulw


People also ask

Does Android studio support SVG?

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.

What is Android PathData?

PathData in vector images android is Vector graphic program's script. It is not exactly clean and human readable code as a high priority.

Where do SVG files go Android studio?

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.


2 Answers

The Resource Manager tool that was added in Android Studio version 3.4 can bulk import SVGs and convert them into vector drawables.

  1. ToolsResource Manager
  2. Select the Drawable tab
  3. Click the + button in the top left corner
  4. Select Import Drawables

There you can select all the files you want to import at once. More details here.

like image 175
Steven Meliopoulos Avatar answered Oct 13 '22 23:10

Steven Meliopoulos


There are few Git projects which would help you achieve the bulk conversion of svg files to Vector Drawable supported by android.

  1. Juraj Novák's : http://inloop.github.io/svg2android/

  2. SvgToVectorDrawableConverter original repo was deleted. But you could choose one of the fork . Example: svg2vd -i "\*" -o out --fix-fill-type

  3. For single conversion: SVG to Vector Drawable Convertor online

  4. Use wrapper of original converter ported from Android Studio

Hope it helps!

like image 43
Siddhesh Dighe Avatar answered Oct 14 '22 00:10

Siddhesh Dighe