I have seen many thread discussing this problem in stackoverflow (like this, this and this), and I have read the documentation about supporting multiple screens, and designs. But I am still not clear about the folder structure for drawables and layout for different screens
I am working on an app that support android phone and tablets. And my project showing some images, which need to be shown in good quality in all possible android devices. And I need to tell my designer to design for all these resolutions.
From the documentation it seems I should add drawables for following resolutions (drawable folder name is given at the end),
1) 240 x 320 - Phone LDPI -> drawable-ldpi
2) 320 x 480 - Phone MDPI -> drawable-mdpi
3) 480 x 800 - Phone HDPI -> drawable-hdpi
//Now for tablets
4) 1024x600 - Tablet LDPI -> ??
5) 1280x800 - Tablet MDPI -> ??
6) 1536x1152 - Tablet HDPI -> ??
7) 2560x1600 - Tablet XHDPI-> ??
From supporting multiple screens documentation, it seems I can use folders like
1) drawable-sw600dp ( a 7” tablet (600x1024 mdpi).)
2) drawable-sw720dp (a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).
But what about tablets with resolutions in the range of 1536x1152, 2560x1600 etc.. the 10' resolution range (720 x 1280 etc)seems small for them.. My client has a Nexus 10 with resolution 2560×1600 and I want my app to look perfect on it..
I know about, nine patch images, layout using wrap_content
and other good practices like that. But for this project, I have some images which, as per requirement, should be seen lazer sharp on all common screens, and I need several versions of those images at least in my bundle.
So what and what resolutions should I mention to the designer? And how can I categorize them in bundle giving correct folder name.
Actually Tablets are categorized by size not by dpi, i.e 7" tab is drawable-large
while your 10" tab is drawable-xlarge
. And now you can again categorized by dpi like drawable-large-hdpi
which means it is a Tab of 7" which having High Density.
you can use SW
smallest width concept to target that, see Application Skeleton to support multiple screen and make calculation for the same.
Tablet Tablets are categorized into two size.
7" (1024X(600-48(navigation bar))) = 1024 X 552 (drawable-large)
10" (1280X(800-48(navigation bar))) = 1280 X 752 (drawable-xlarge)
and for 2560x1600 calculate SW dp with formula
px= Device's width
dpi= Device's density
formula given
px = dp * (dpi / 160)
interchange formula if you have px's value
dp = px / (dpi / 160)
so drawable-swxxxdp will do the job