Make Android SVG to Vector Drawable Easily
What is SVG ?
SVG stands for Scalable Vector Graphics. SVG defines vector-based graphics in XML format.For an android developer or designer it is very recomended to SVG files instead of PNG,JPG,JPEG files because we can easily modify the pathdata in XML to achieve our desired design. Every element and every attribute in SVG files can be animated.
Advantages of using SVG files
- SVG is an open standard
- SVG files are pure XML
- SVG images can be searched, indexed, scripted, and compressed
- SVG images are scalable
What is Vector Drawable?
This lets you create a drawable based on an XML vector graphic. To optimize for the re-drawing performance, one bitmap cache is created for each VectorDrawable. Therefore, referring to the same VectorDrawable means sharing the same bitmap cache. In other words, if a VectorDrawable is used for different sizes, it is more efficient to create multiple VectorDrawables, one for each size.There are several elements in Vector .But here we will the main element and basically most used element for converting in vector (path) android:pathData=” ”.
For a designer he/she can find SVG files from Adobe Xd usually like the following .
I have used two methods for converting this . I hope it will help for you guys .
First:
Then upload your SVG file and and select path
Bang. Now you will get your path data .
Second:
One of the lifesaver for me .
Drop file here
It is easier than first one .Actually you can directly copy and paste the XML code from here to android studio .
Thanks for being here.Have a nice day .