How to Use SVG in Android Development
Android natively supports vector graphics via VectorDrawable XML — convert your SVG to VectorDrawable for scalable, theme-aware icons in Android apps.
Drop your image here
Supports PNG, JPG, BMP, WEBP up to 5MB
Converting SVG to Android VectorDrawable
Android Studio has a built-in SVG-to-VectorDrawable converter.
- In Android Studio: right-click res/drawable folder > New > Vector Asset
- Choose 'Local file (SVG or PSD)' and browse to your SVG
- Android Studio converts the SVG to VectorDrawable XML automatically
- Preview in all densities (mdpi through xxxhdpi) in the preview panel
- Click Next > Finish — your VectorDrawable XML is saved in res/drawable
Using VectorDrawable in Your Android App
Use the VectorDrawable like any other drawable resource in XML or Kotlin/Java code.
- XML: android:src='@drawable/ic_icon' on ImageView
- Kotlin: imageView.setImageResource(R.drawable.ic_icon)
- Animated: AnimatedVectorDrawable for SVG animation converted to Android XML
- Tint: app:tint='@color/primary' on ImageView to colorize the icon
- AppCompat: use AppCompatImageView for API < 21 support with vectors
Frequently Asked Questions
Why doesn't Android support SVG directly?
VectorDrawable is Android's own vector format optimized for the Android rendering system. Direct SVG would require bundling a full SVG parser/renderer, adding APK size and complexity.
What SVG features are lost when converting to VectorDrawable?
VectorDrawable supports: paths, fills, strokes, gradients, clip paths. Not supported: SVG filters, text, raster images inside SVG, CSS classes, or complex transforms. Simplify SVGs to paths before converting.
Is there a way to use SVG directly in Android without VectorDrawable?
Yes — the androidsvg library renders SVG directly at runtime. Or use Coil or Glide image loaders with SVG extension libraries. VectorDrawable is still recommended for icons and simple UI graphics.
How do I add SVG to an Android ImageView in Kotlin?
After converting to VectorDrawable: imageView.setImageResource(R.drawable.your_icon). Or load SVG directly with Coil: imageView.load("file:///android_asset/icon.svg") { decoderFactory { SvgDecoder.Factory() } }.
Related guides
Ready to Convert Your Image to SVG?
Free online converter — no sign-up, no watermarks, results in under 3 seconds.
Try It Free — Convert Image to SVG