Avoid multiple sets (hdpi / mdpi / ldpi)

Is there a way to avoid having multiple sets of resolution drawings? I have about 50 images (mostly simple icons, not using anything that needs a 9 patch), there seems to be a lot of redundant work to resize all 50 in Photoshop, also considering a rework if I have to change some icons in the future.

I understand the need for adjustments for several densities, but is there a way to avoid this, you can say by simply providing a high-quality image, and then applying the size as DP / DIP?

I also see that in my Android project there is only a "Drawable" folder in addition to * hdpi / mdpi / ldpi, what are the consequences if I just put all my image resources in this folder instead of special permission? (assuming I'm fine with resizing images on the device)

+4
source share
5 answers

If you do not care about all the potential problems with different densities than go ahead and put all your drawings in the drawables folder. They will be correctly selected. But you will find that in the long run it is better to have a larger application size than a worse looking application.

In addition, it is usually safe to place 9-patches in drawables, since they usually do not contain density-specific data (for example, complex images).

+2
source

Quick tip for resizing images: FastStone image resizer

This is a fast, simple and free image image that does not seem to lose quality. I use it very often, and it never let me down. Also works with transparent PNG.

+3
source

You can provide images with only one density. But you will have fuzziness when you zoom in and lose detail when you zoom out. This probably has little to do with photorealistic images, but will be more apparent in linear art. For best results, draw your badges in vector format and export them in different sizes. For simple line drawings, I like to use Google Docs.

+1
source

How about vector graphics? Which can be changed without loss of quality. AndEngine has the SVG extension, AndEngine is basically a game engine, but you can also create your own application. With svg files you do not have to worry about the size of the application.

0
source

You can easily resize any images in xxhdpi, xhdpi, hdpi and mdpi by checking this site . Hope this can help you.

0
source

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


All Articles