0

I am developing a game and want to support all screens which have 240dp density. These screens lies in hpdi-category of Android e.g. some tablets like 10.1" and 7.0", some phones which have 480*800 screens, etc. Can you please tell me how to provide alternative drawables. Thanks in advance.

3 Answers 3

2

Just put the drawable files into the drawable-hdpi or drawable-mdpi folder respectively.

For full control depending on your needs you might want to check http://developer.android.com/guide/practices/screens_support.html

Here you find all the possibilities...

You may especially check the new size qualifiers. In particular (also from the link above):

For other cases in which you want to further customize your UI to differentiate between sizes such as 7” and 10” tablets, you can define additional smallest width layouts:

res/layout/main_activity.xml # For handsets (smaller than 600dp available width) res/layout-sw600dp/main_activity.xml # For 7” tablets (600dp wide and bigger) res/layout-sw720dp/main_activity.xml # For 10” tablets (720dp wide and bigger) 
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your response. i have designed layouts for all screens but only problem is with drawables. Is there any thing like res/drawable-hdpi-phone and res/drawable-hdpi-tablet? As my ASUS Transformer and Galaxy Vibrant have same density i.e. 240dp.
i am facing the same issue.did you got any workaround of this ?
0

Answering the next question, you can qualify for the whole range of options, from current locale to display width/height. See http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources

Comments

0

You can use size or density qualifiers for your drawable folder. If you for example have a fullscreen background drawable for a tablet and for a phone you can create a drawable-xlarge folder. This folder will be used on a table only. You could also combine the ressource qualifiers like drawable-xlarge-hdpi. For more information on this read Providing Ressources.

I would suggest to specifiy your layout by screen size only. Resulting in four layout folders layout-small, layout-normal, layout-large, layout-xlarge. The normal drawables that only need a bigger resolution with a higher screen density like buttons or other stuff that is shown in the same size on phones and tablets should be put into the density dependent folders like (drawable-ldpi, drawable-mdpi, drawable-hdpi, drawable-xhdpi).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.