Bear with me, I'm new!
I want to use vectors in my android app, and I want my app to be backwards compatible. I found this support library that looks pretty cool!*
So I'm confused about how I would I 'install' it. It gives you a link to download the .pom, .aar, javadoc.jar, and the sources.jar file. Which one should I download, and where (what folder) should I put the file?
(I'm using Android Studio!)
*(Anybody know a different VectorDrawable support library? I'd be interested in hearing everybody's experience!)
VectorDrawable Backwards Compatibility And Installing Unofficial Support Libraries
4.8k views Asked by Avery Miller AtThere are 4 answers
Thanks for the people who ported this lib before Google!
Great news is that google released Android Support Library 23.2 Support Vector Drawables and Animated Vector Drawables !
Note:
- Vector images all the way back to API 7 (Android 2.1 Eclair).
- Animated vectors are a bit more limited, going only as far back as API 11
The best solution I found is the BetterVectorDrawable lib together with the SVG to VectorDrawable Converter.
BetterVectorDrawable is the VectorDrawable implementation for Android 4.0+ with configurable fall-back behavior on Android 5.0+. The lib can be added to a project with just one line (see readme).
SVG to VectorDrawable Converter is the batch converter of SVG images to Android VectorDrawable XML resource files. Online version is here.
Links point to readmes, which provide enough information on how to use the lib and the converter.
Google just announced Android Studio 1.4 with backwards compatibility for Vector Drawables. It will generate .png files in the appropriate sizes for the different screen densities for pre-Lollipop devices and will use the vector format for Lollipop and up. See this link: http://android-developers.blogspot.com/2015/09/android-studio-14.html
Just make sure that your Gradle Build version is 1.4.0 or above!
Here is a option that worked for me Use this library - https://github.com/wnafee/vector-compat (api 14+)
And create a custom ImageView class that uses vector compat class -
Vector image example -
Example -