

Now, if the text is very simple it could be worth converting it to paths. They can only define lines, curves and colours. If your graphic relies on them then default back to providing multiple sized assets. Vector Drawables don't support gradients or patterns. Icons are ideal, large illustrations of cityscapes are not. However, if the graphic is complicated it could become noticeable to the user. When the graphic is simple it can easily handle that and its effects on performance are negligible. But rather than the app serving up a pre-rendered bitmap image, it now needs to take XML file, parse it and draw the graphic. Using Vector Drawables can dramatically reduce the APK size of an app. The limitations imposed by vector drawables. My personal limitations with vector design (I'm not the strongest illustrator). How long it would take me to produce them and the trade-off of the benefits.

Note! I'm basing these on a combination of factors, such as: To help with this I've come up with a few general rules below. One of the hurdles for me when first exploring vector drawables was understanding when I should or shouldn't use them. The general principle is to keep them as simple as possible.

This means that you need to take some care when creating them. Vector Drawables do not support everything that SVGs do. You could write the XML from scratch but unless it's a super simple shape, that would be a very difficult and time-consuming effort. That XML is what Android uses to build the graphic and display it. The conversion takes the building blocks of the SVG and converts it into XML. Vector Drawable are generally created from converted SVGs. But the SVG standard shares many similarities and is widely used, so it's the best starting place. SVGs and Vector Drawables aren't the same thing. In general, to get an image to become a Vector Drawable, we start with an SVG. The second advantage is that using Vector Drawables can dramatically reduce the size of an apk. Now, we can have one xml file that we can use wherever we want at what ever size we want. Before, the only way to guarantee that a graphic would display properly on different screens sizes and densities was to create many sizes of that graphic. We use them for the simple reason that they will display on any screen dimension at any size with minimal loss of quality. View video Plain English pleaseĪccording to Android's documentation: 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. We've been busy creating vector drawables for Android using Sketch.
