2

I am a newbie programmer, but I am almost done with my android game project.

However I still don't know how to use the drawable folders properly.

For example, if I have a image that is 32 by 32 pixels, which folder does it go to? And how big do I have to make it for the other folders?

Currently, I have these folders listed below: -drawable-hdpi -drawable-ldpi -drawable-mdpi -drawable-xhdpi

Since i did not know where to put my images, i just put them in all the folders but i don't think that's right....is it?

Thanks for helping.

ChiefTwoPencils
  • 13,548
  • 8
  • 49
  • 75
Zunair Syed
  • 172
  • 4
  • 13
  • Look you need to study about supporting multiple screens. Also first read the docs and this is a QA forum , not a tutorial website. http://developer.android.com/guide/practices/screens_support.html#overview – Prateek Aug 21 '13 at 07:06
  • possible duplicate of [Drawable-hdpi, Drawable-mdpi, Drawable-ldpi Android](http://stackoverflow.com/questions/3263265/drawable-hdpi-drawable-mdpi-drawable-ldpi-android) – Prateek Aug 21 '13 at 07:08
  • Please choose one of the answers if you feel it has helped you to resolve your issue. It will help others to identify right answer quickly thereby making thread more useful.. Thanks – Sushil Aug 21 '13 at 23:33
  • See my basic explanation of android's process of determining resources. I provide a link that you should read for more understanding. Don't forget to upvote/accept informative answers! – ChiefTwoPencils Aug 22 '13 at 07:13

2 Answers2

1

For each image you need to create multiple images to support different screen resolution (mdpi, hdpi, xhdpi, xxhdpi). Then you can place them in appropriate folders you have created. In drawable folder you keep the xmls which internally uses other drawable folders.

The link below will give you idea about supporting different screens:

http://developer.android.com/guide/practices/screens_support.html

The below link will give clear pictures about icons:

http://developer.android.com/design/style/iconography.html

You can use Android Asset studio to generate icons. Follow link below:

http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html

In case you cannot get different images for different screen resolutions, just put them in drawable folder and it will be picked for any device. But the look and feel of your application wont be good on different devices.

Hope it helps you.

Sushil
  • 8,250
  • 3
  • 39
  • 71
  • ok so let me just make sure what i understood.... So if i have a picture that is 48x48 pixels, then for low desnisty folder, i put the picture of that in 36x36 & for high density folder is 72x72 and for xtra high is 96x96....is that right? and is that all i have to do? – Zunair Syed Aug 22 '13 at 01:13
  • Yes, you got it correct. You need to maintain this ratio for images: 2:3:4:6. – Sushil Aug 22 '13 at 01:36
  • that's it right...nothing else about how big he size of the picture has to be or something else like that right? hx – Zunair Syed Aug 22 '13 at 03:05
  • Normaly the size you mentioned above in your comment and in the "iconology" link should be followed for size. And for some other images for which you are not sure about size, just try to fit it properly for your one development phone with known resolution and then set other sizes as per ratio table – Sushil Aug 22 '13 at 03:57
1

Look this link there are lots of blogs written about this

1.http://developer.android.com/guide/practices/screens_support.html#overview

2.http://developer.android.com/training/multiscreen/screensizes.html

3.http://www.slideshare.net/rffffffff007/supporting-multi-screen-in-android

Siddharth
  • 9,349
  • 16
  • 86
  • 148
Nithinlal
  • 4,845
  • 1
  • 29
  • 40