Question

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top