6
votes

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

2
you say that all the time s4 and s3 both picks from layout-sw360dp-xhdpi -> is that a bad thing ? why would you like to do different xml files, is not looking alright on every device ? - Hitman
might problem in folder name formation, check if its ok to use densities qualifier with 'layout-x-x' coz i search for the case and found it is use with 'drawable-x-x' i.e 'drawable-sw800dp-hdpi' - KumailR
@Hitman yes, my need is to differentiate s4 from s3. Also, any layout wont look same on both of these devices. - Rohit
this will give you some help, stackoverflow.com/questions/11699761/… - KumailR
@smkrn110 Thx, I checked that but still not working. - Rohit

2 Answers

2
votes

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.

1
votes

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.