Climbing in anroid studio, I found vector graphics files in (these cases were icons, in .xml format). There was a question, is it appropriate to keep a logo in this format that is displayed on the splash screen? If so, how does this format scale to different screens?

2 answers 2

This is the VectorDrawable format. If it’s possible to describe your logo through a vector, then storing it in this form is more than appropriate, as only one small file is required for all screen resolutions, instead of a whole set of rather heavy graphic files for different resolutions for which additional system resource is still spent on determining the current configuration and the appropriate resource. It is also possible to use the animation directly in the XML file ( AnimatedVectorDrawable ).

Android Studio includes a converter from SVG and PSD format to VectorDrawable format, so you can draw something in a full-fledged vector graphics editor and then import it into your project. There are limitations , since VectorDrawable simpler and does not implement all the features of SVG (the conversion may not turn out to be correct), but in practice this happens rarely.

Like any vector (for example, SVG), such graphics perfectly scale to any size, maintaining a clear view and cleanliness of the lines, in contrast to the raster.

Also in Android there is a simplified pseudo-vector format ShapeDrawable , which allows you to draw some primitives, paint them and so on. If the capabilities of this tool are enough to display what you have planned, then it should be preferred to the heavier VectorDrawable , since this is a native system tool.

If there is an opportunity to use a vector instead of a raster, it should be preferred in any cases of working with graphics - logos, icons, background of widgets, etc.

    It is appropriate. and scaled vector graphics better than raster. Vector graphics store only the commands for which it is drawn, so nothing hinders its scaling.