shemsu
shemsu

Reputation: 1076

Android layouts tree, human readable explanation?

If I write a message today is for getting details about the folder tree layouts in android.

I want to warn you now, I have read all the pages of the official documentation regarding support for different screen sizes, it is very complete, but in my opinion not really human-readable. So please, don't just copy a link to the documentation.

My question is simple:

What is the best combination of layouts folders to ensure maximum support for different screen sizes ?

Before Honeycomb, we had layout, layout-large, layout-xlarge, etc ... That's OK, but now we have sw600dp, sw360dp, sw ... Arggh stooop !

In my case, I have to make an application for android and I need to ensure maximum support.

I have some devices on hand:

Galaxy Note 10.1 Galaxy Nexus Nexus S Nexus 7 And ... Samsung Galaxy Spica (GT-5700)

And here are my layouts folder now:

layout
layout-sw360dp (for Galaxy Nexus)
layout-sw600dp (for Nexus 7)
layout-sw720dp (for Galaxy Note 10.1)
layout-480x320 (for GT-5700)

(and layout-*-lands)

I'm really not sure of doing things right, I thought the Nexus S would pick the layout folder, but it takes the layout-480x320, why?

So I have some questions:

1. Am I in the right direction?

2. Is it always necessary to create folders layout-large, layout-xlarge ... ? If so what should I put inside?

3. I do think the folder layout-480x320 is not a good solution, but I try to do things well and not make this folder is not enough.

Could someone tell me clearly how to do things right?

Thank you!

Upvotes: 1

Views: 510

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006744

What is the best combination of layouts folders to ensure maximum support for different screen sizes ?

That is impossible to answer in the abstract.

Am I in the right direction?

-layout-WxH has been deprecated for a couple of years.

Is it always necessary to create folders layout-large, layout-xlarge ... ?

No. If you are not concerned about Android 2.x -large or -xlarge devices (e.g., Kindle Fire, NOOK) or Android 3.1 devices (0.4% of the market as of November 2012), then skipping -large and -xlarge is perfectly fine.

However, -small may still be relevant for you, for devices with very small screen sizes (under 3" diagonal), if you are supporting such devices.

I do think the folder layout-480x320 is not a good solution

Correct.

I try to do things well and not make this folder is not enough.

Then design a more flexible UI for -layout.

Upvotes: 1

Related Questions