Вопрос

I am facing a problem with the size of the generated apk for my app...

I was wondering if there can be any issue if I use only the xxhdpi folder for my drawables... I know that there can be some problem with 9 patch drawable but I don't have any.

The system should take care for scaling down my images, right? Are there other effects that can be dangerous?

Это было полезно?

Решение

  1. Yes, system takes care for scaling, but scaling at runtime can affect your app's performance, especially when the scaling factor is not power of 2.

  2. Normally scaling down a image wouldn't cause quality problems. however, it may produce a minor impact on image quality under some circumstances, here's a test:

    image in xxhdpi folder, left side is how it looks like on a Nexus 5 (xxhdpi), right side is how it looks like on a Nexus 4 (xhdpi). enter image description here

  3. If image size is less than 4px, app may crash when scaling down.

Conclusion: if app size is more important than problems above, then you can put all images in xxhdpi folder, except the small ones.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top