XML based graphics and png drawings?

My partner, developer, and I, the developer, are currently trying to figure out what is the best approach to application performance and quality on all devices.

There are many cases where we can create real graphics, such as button states and background backgrounds, to name a couple, all based on xml. Some of them are complex and have several layers and gradients, while others have simple shapes.

At what point would it be desirable to have real images of graphic images?

I think the advantages of xml-based graphics are of higher quality and can be stretched and placed with flexibility on all devices, while the actual drawings of the images should be properly calculated according to each screen density or use nine patches.

Could there be a penalty for performance trying to create these xml shortcuts?

+6
source share
1 answer

Premature optimization is the root of evil.

Also good suggestions here: Efficiency is generally better using an image or created xml form as portable? and here is Android Graphics Drawing Performance?

+3
source

Source: https://habr.com/ru/post/904043/


All Articles