Is it enough to create a drawable folder and put them all images only there? I have to scale all images and put them all according to their size? (to drawable-xhdpi, drawable-xxhdpi, drawable-mdpi, drawable-hhdpi). Thanks
-
say more about your situation. only drawable is enough if you are targeting only certain device, but for wide variety of devices you need most of the drawable versions according to different pixel sized images. – Navdeep Singh Feb 24 '14 at 09:04
-
yes, if you want that your images scale the same way on different devices you should provide every drawable with the correct density – Blackbelt Feb 24 '14 at 09:05
-
to place a image in your background, use background property for activity's layout. – Navdeep Singh Feb 24 '14 at 09:07
-
Thanks. Which size of image to place in drawable folder? Same on drawable-xhdpi or drawable-xxhdpi or drawable-mdpi on drawable-hhdpi? Or drawable folder is useless? Other folders are enough? – Utku Soytaş Feb 24 '14 at 09:10
-
1use this to calculate your image ratio: http://coh.io/adpi/ – Navdeep Singh Feb 24 '14 at 09:16
-
Also I have large size of image(1440x2160) and I have fatal signal 11 (sigsegv) error. I think that image cause this. What should I do? – Utku Soytaş Feb 24 '14 at 09:20
2 Answers
From the Android Developer site, there's this paragraph.
To optimize your application's UI for the different screen sizes and densities, you can provide alternative resources for any of the generalized sizes and densities. Typically, you should provide alternative layouts for some of the different screen sizes and alternative bitmap images for different screen densities. At runtime, the system uses the appropriate resources for your application, based on the generalized size or density of the current device screen.
This confirm that you have to create differents images for every resolution and density you want to support.
Remember you can exclude some screen typology through the Android Manifest configuration

- 602
- 1
- 7
- 23
This link explains very good the functionality of the drawable and how to support another screen sizes: http://developer.android.com/guide/practices/screens_support.html
Drawable folder is the default folder. I mean, if you don't have the other specific folders (drawable-xhdpi, for example) and your device has this dimension, it will use the default folder.
So, asking to your cuestion, it is recommendable to create a folder for each size(drawable and layout) but you are not obligated (depends on you).

- 63
- 8