Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android- How to differentiate Galaxy S-3 and Galaxy S-4 layouts?

I am having problem differentiating layout folders for samsung galaxy s4 and samsung galaxy s3. I have tried layout-sw360dp, layout-sw360dp-xxhdpi, layout-sw360dp-xhdpi etc. All the time galaxy s4 and galaxy s3 both picks from layout-sw360dp-xhdpi.

So what should be the correct layout folder for both of these devices ?

enter image description here

like image 549
Rohit Avatar asked Dec 10 '13 07:12

Rohit


2 Answers

I am using some specific resolution values in my projects in order to differentiate these from other layouts and screens.

You can create layouts with exact minimum height and width values that can be seen from gsmarena.

Samsung S3: http://www.gsmarena.com/samsung_i9300_galaxy_s_iii-4238.php

S3 layout folder name: layout-w720-h1280

Samsung S4: http://www.gsmarena.com/samsung_i9500_galaxy_s4-5125.php

S4 layout folder name: layout-w1080-h1920

So they will be using corresponding layouts by creating layout folders like these.

like image 122
canova Avatar answered Sep 20 '22 02:09

canova


The Galaxy S4 has a Full HD screen, you could create a separate layout for this resolution by using layout-xxhdpi for the S4 and layout-xhdpi for the S3.

like image 26
Mark Buikema Avatar answered Sep 22 '22 02:09

Mark Buikema