How to convert a png file to xml resource by Android?
You can import a svg asset and convert it into a vector.
Click on new vector asset and you will have two options , psd and svg. Import your svg file and it will be stored as a xml file.
In current Android Studio version (3.6 rc1), you can import png image directly. File-> New-> Image Asset.
In the Asset Type, select Image, provide path to your image file and click on Next and Finish buttons.
Android Studio would do the conversion for you.