Search code examples
androidxmlimagesvgmobile-application

SVG imported into Android Studio is blurry when viewed as XML


I had a designer create a logo in SVG format for me. After importing into Android Studio via drawables->New->Vector Asset, I am able to open the file to view its code and/or see the logo itself. It looks fine until I zoom in:

enter image description here

Does anyone know if this is normal behavior for Android Studio or is there a problem with the SVG file? First time making a real app. Do I even need vectors for my drawables or can I just use high resolution PNGs? What's the industry norm here?


Solution

  • Does anyone know if this is normal behavior for Android Studio

    Yes, at least through Android Studio 4.1. It is not re-rendering the SVG at different zoom levels — it is zooming in on the already-rendered SVG as a bitmap. Studio's resource design view is fairly new and is not that sophisticated.

    Do I even need vectors for my drawables or can I just use high resolution PNGs?

    Prefer vector drawables over PNGs, where practical. Android Studio's ability to create vector drawables from SVGs is modest, as there are lots of SVG features that vector drawables do not support. But vector drawables tend to be smaller and scale better than PNG counterparts.