Search code examples
androidxmlpng

How to convert a png file to xml resource by Android?


I want to convert my png file to xml resource that can be accepteed by android. I converted it by using the website below.

https://convertio.co/fr/png-svg/

Then I downloaded it then put it in resource directory and changed type to xml, but android didn't accept it of course.


Solution

  • 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.