0

After doing my prior research on the top 10 handsets and tablets in my country, I can classify them as follows:

HANDSETS:
533dp x 320dp
640dp x 360dp
853dp x 480dp  

TABLETS:
1280dp x 800dp
960dp x 600dp  

So, given that I am supporting API level 11 and up, I will need to include both the older way of specifying the layouts as well as the new. So, my layouts will look as follows for the older versions:

res/layout/my_layout.xml             // layout for normal screen size ("default")
res/layout-small/my_layout.xml       // layout for small screen size
res/layout-large/my_layout.xml       // layout for large screen size
res/layout-xlarge/my_layout.xml      // layout for extra large screen size
<< and the corresponding landscape >>   

The newer one with sw<N>dp would look like this (for handsets):

res/layout-sw320dp/my_layout.xml
res/layout-sw360dp/my_layout.xml
res/layout-sw480dp/my_layout.xml
<< and the landscape >>
res/layout-sw320dp-land/my_layout.xml
res/layout-sw360dp-land/my_layout.xml
res/layout-sw480dp-land/my_layout.xml  

So, here are the questions:

  1. Have I added the layouts with newer qualifiers properly?
  2. The official docs state 426dp x 320dp and 470dp x 320dp as proper screen sizes as examples. I have a rather strange 533dp x 320dp. Have I made an error in calculating the DP size?
  3. Is the default layout with no qualifiers even needed or is that an overkill?
An SO User
  • 24,612
  • 35
  • 133
  • 221
  • If you can identify the parts of your layout that expand to take up any slack space, you can generally make do with a lot fewer resource folders. Regarding question 3: quite often it's the only one you need (also it's mandatory to have the default folder). – Barend Jan 31 '15 at 14:04
  • @Barend True for the first part. I haven't used newer method for specifying the layouts until now. I am more concerned about adding them properly. As for a lot of layout folders, a lot of layouts will simply be copied to the older folders like `x-large` and likes so the effort is concentrated on the newer specifiers. – An SO User Jan 31 '15 at 14:05
  • Ah, my apologies. I read it as a "I am an experienced developer preparing very thoroughly for my first Android project" kind of question and didn't realize you've prior experience. With regards to simply copying: consider using the [layout alias](http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters) trick hidden in the Training pages. – Barend Jan 31 '15 at 14:09
  • @Barend Preparing thoroughly? Yes. Experienced? PFFFFFT! What layout folders are usually included, anyway? It's a question that's been on my mind for some time :) – An SO User Jan 31 '15 at 14:16

0 Answers0