Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android S3 layout vs Galaxy Nexus layout

I've developed an app that was supposed to target both the Galaxy Nexus and the Galaxy S3. Both have 720 x 1280 screen resolutions and I have only used 'dp' values in my app. The resources exist in the 'layout-xhdpi' and the 'drawable-xhdpi' folders. Layout looks perfectly fine on the Nexus, but the padding values (in dp) is slightly off on the S3. I assume its because of the bigger screen size on S3 and difference in density.

How can I create a separate folder for Nexus and S3 so I can take into account the different screen sizes?

like image 432
karlstackoverflow Avatar asked Jul 28 '12 09:07

karlstackoverflow


3 Answers

Use this scheme:

For same layout landscape and portrait layout-sw360dp

Only for landscape layout-sw360dp-land

Only for portrait layout-sw360dp-port

I try to say you can use the before clasification creating folders with theses names. The layout located into are loaded in the Galaxy S3 - WXGA720. This is a way for disting the layout for this type of device. Its necesary Android 4.0+.

like image 83
Zeus Monolitics Avatar answered Oct 22 '22 22:10

Zeus Monolitics


I use sw360dp-long which the system will use for the GS3 and I use sw360dp for the Galaxy Nexus.

like image 5
Mikey Avatar answered Oct 23 '22 00:10

Mikey


Nexus 4: use sw384dp (768x1280)

Samsung S3: use sw360dp (720x1280)

It should be noted that both do fall into the sw360dp bucket, but some developers might need to make things pixel perfect, so the 384 folder might be needed but should be avoided if you can design a more flexible layout using LinearLayout and "weight" instead of hardcoding dp units.

like image 2
whyoz Avatar answered Oct 22 '22 23:10

whyoz