Why are so many folders named "Drawable" on Android?

6

I have a silly doubt. I already know that the Drawable folders on Android is to put the images with the relevant resolutions. For example, the drawable-ldpi folder is to put images at low resolution.

But my question is this: When I make an image to put in some application I will need to create it in several different resolutions?     

asked by Jhonas Kenne Boeno 15.04.2014 в 04:29

3 answers

5

You do not necessarily need to create multiple images at different resolutions. There is a transition over the resolution of the devices' screens. In a while all the devices will have the screen with high resolution. But in the meantime, to give a better design in older devices and those of very high resolutions is, in many cases, necessary to use this device.

There are good tips on the Android website:

Usually uses if the drawable-mdpi folder, as it is the one with the most devices currently. When there are no images for the resolution, if that is different, Android manages this exchange.

    
15.04.2014 / 05:05
2

Dude, as for images, you really have to generate several different sizes, if you want the app to work well on different devices, using various drawable folders.

But I have two tips for you, which are a hand in the wheel:

1st To build icons for your application ( icon_launcher / icons for actionbar / navigation drawer / or even create an icon with android defaults, from any image ) use this site < a href="http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html?utm_source=twitterfeed&utm_medium=twitter"> here and be happy:)

2nd One way (not the most correct, but one that works best) is to create several values folders (examples: values-normal-hdpi / values-normal-mpdi / valuessw600dp ), with a different styles.xml file for each of them. So you use a single image with a good resolution and change the width and height for each screen resolution. And you can still use these styles as your own library for use in other applications.

If you want to understand better, just talk:)

Good luck.

    
15.04.2014 в 22:47
1

It is good for you to create multiple images, one for each folder, one with low resolution, one medium, and so on. Because so you will gain greater "elasticity" for the different sizes of devices and screen resolutions, so the android will identify the image that is most suitable for the resolution of the device.

Read the documentation that talks about it at: Supporting Multiple Screens

    
15.04.2014 в 04:59