Convert SVG to Vector Drawable In Android Studio

What is SVG ?

SVG stands for Scalable Vector Graphics.
SVG defines vector-based graphics in XML format.

What is VectorDrawable ?

A VectorDrawable is a vector graphic defined in an XML file as a set of points, lines, and curves along with its associated color information.

Advantage of VectorDrawable over PNG 
  1. It can be scaled without loss of display quality which means the same file is resized for different screen densities without loss of image quality .
  2. Same file can be used in normal and dark (Just have to apply color tint to vector drawable).
  3. Helps in reducing APK Size . 

To Convert SVG To Vector follow below steps in android studio 

1. Right click on resource folder of your project , then click on new and then click on Vector Asset .
2. A popup window will open select Local SVG option and then browse path then select SVG Icon and then click ok  .


No comments:

Post a Comment