I'm reading and watching UI tutorial. They all talk about the fact that you need to be aware of different devices size and resolution. Therefore export your icons into several size to support different screen density. SVG is an open standard (W3C) that should be use to tackle this kind of problem. So can I natively use SVG file as drawable for my icons ?
N.B.: I'm NOT talking about browser support.
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.
Use of SVG Image: Recommended or Not Using SVG images in an Android application can be extremely complicated. That is why so many designers recommend that you don't do it. There are so many other ways in which SVG images can be used more effectively.
SVG images can be used as background-image in CSS as well, just like PNG, JPG, or GIF. All the same awesomeness of SVG comes along for the ride, like flexibility while retaining sharpness. Plus you can do anything a raster graphic can do, like repeat.
Android does not support SVG rasterization. Look at libsvg-android or svg4mobile. It solves that problem.
The answer has changed. Since version 21, Lollipop the operating system has had support for VectorDrawable. This is added to by a support library that allows you to use VectorDrawable well back into previous versions. These include support for importing most of the important SVG vector commands and having Android Studio automatically convert them to a VectorDrawable.
Use Vector Image Assets for all versions. -- Also even in older versions it's entirely possible to do fonts. Basically you give it a font asset then load up a specific letter of the font as an icon. Since fonts are glyphs and vector glyphs at that, you can very much get vector icons pretty far back.
https://fortawesome.github.io/Font-Awesome/icons/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With