newday
newday

Reputation: 3878

Setting different layout for different mobile deveices in Android

In my application, I want to set different font size and paddings for different mobile devices. I use this method explain in Android documentation.

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
res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation

The problem is that both galaxy s2 and galaxy note 2(720x1280) mobiles use xlarge/my_layout.xml file. These phones have different densities. Therefore, both of them don't behave same way.

For galaxy note 2 xml is perfect but now I need to change paddings of titles and font size for galaxy s2 mobile. Is there particular way to identify 480x800 screen(galaxy s2)?

Upvotes: 0

Views: 273

Answers (1)

Sanket Kachhela
Sanket Kachhela

Reputation: 10876

use folder layout-sw360dp for Nexus 4 and layout-sw400dp for galaxy note. may be it will help you.

Upvotes: 1

Related Questions