Why so many folders with the name "Drawable" on Android?

Asked

Viewed 3,192 times

6

I have a silly question. I already know the folders Drawable in the Android is to put the images with the relative resolutions. For example, the folder drawable-ldpi is to put images with low resolution.

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

3 answers

5


You don’t necessarily need to create multiple images with different resolutions. There is a transition from the resolution of the screens of Vices. After a while all Vices will have the screen with high resolution. But meanwhile, to give a better design in older devices and those of very high resolutions is in many cases necessary to use this artifice.

There are good tips on the Android site:

Usually uses if folder drawable-mdpi, because it is the with more Vices currently. When there are no images for resolution, if this is different, Android manages this exchange.

2

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

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

1st For building icons for your application(icon_launcher/icons for actionbar/navigation Drawer/ or even create an icon with android patterns from any image) uses this site here and be happy :)

2nd One way (not the right way, but one that works best) is to create several values folders (examples: values-normal-hdpi/values-normal-mpdi/valuessw600dp), with a file Styles.xml different 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, to use in other applications.

If you want to understand better, just talk :)

Good luck.

1

It is good that you create several images, one for each folder, one with low resolution, an average, and so on. Because thus you will gain greater "elasticity" for the different sizes of gadgets 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 on: Supporting Multiple Screens

Browser other questions tagged

You are not signed in. Login or sign up in order to post.