Android doesn't read SVG — it draws a VectorDrawable, an XML format with its own attributes and a smaller feature set. This converts the SVG above into real VectorDrawable XML you can drop into res/drawable, with dp sizing and the correct fill rule. It runs in your browser, so the file stays on your machine.
How to convert an SVG to Android XML
- Load your SVG above, or edit the even-odd sample. It stays in your browser.
- Open the Code tab and choose Android VectorDrawable.
- Read the note listing any features that were stripped.
- Copy the XML, or download
ic_name.xml.
What maps across
- A
<path android:pathData>per shape — rectangles, circles, ellipses, lines, and polygons all become path data, since a vector drawable only draws paths. - Fills and strokes map to
android:fillColorandandroid:strokeColor(as #AARRGGBB), with stroke width, line cap, and join. - The viewBox sets
viewportWidth/viewportHeight; width and height become dp. android:fillType="evenOdd"is emitted only when a path needs it — which is why that path requires minSdk 24.
What gets stripped, and why
Gradients, patterns, masks, clip paths, filters, text, and embedded images either don't exist in a plain vector drawable or belong in a separate asset, so the converter drops them and reports each one. That way you flatten or replace them on purpose instead of shipping a broken drawable. For icons — the usual reason to want an android vector drawable, or to go from svg to android xml — the artwork is normally solid paths, which map cleanly and stay crisp at any density.