Android Vector Icon Drawable
Alternatively you can also use android studio to generate vector drawables from svg generated in step 1.
Android vector icon drawable. Right click on drawable folder. In the dialog click the button in the third row with a random icon next to the label clip art. This will open up the android studio vector asset generator. Open build gradle in app module add the below line inside defaultconfig block.
When i right click the drawable folder in android studio and choose new vector asset it drops the vector image xml in my drawable folder. I use vector drawable as drawableleft for the button and changed the button drawable colour programmatically using kotlin like this. In order to add this functionality in a mobile application android studio includes a tool called the vector asset studio that is used to add some predefined material icons along with your own scalable vector graphic svg and adobe photoshop document psd as vector files in your android application. Create a new project in android studio from file new project and fill the project details.
Inside android studio right click on your drawable folder new vector asset. Select a local svg file the one you generated online. Go to new vector. Android vector graphics android 5 0 api level 21 was the first version to officially support vector drawables with vectordrawable and animatedvectordrawable but you can support older versions with the android support library which provides the vectordrawablecompat and animatedvectordrawablecompat classes.
Flaticon the largest database of free vector icons. In the project right click on the drawable directory 4. Click on vector asset.