Alvin
Alvin

Reputation: 894

Android same category but different size devices?

I'm developing an android app. I've done much so far, but I've some problems. So far, I've compiled the app on Nexus 5 and I've designed the layout for that device. I know that, I should have different layout folders for different screen categories, but my problem is that, for example, my app works pretty good on Nexus 5, but not good on Nexus S.

And I also know that those 2 devices are in the same layout category.

How can I solve this issue? I want a layout for Nexus S which differs Nexus 5.

Note: Please, do not comment documentation links. I've read them all, but couldn't solve my problem.

Thanks!

Upvotes: 0

Views: 54

Answers (1)

Rami
Rami

Reputation: 7929

From official documentation:

  • ldpi (low) ~120dpi
  • mdpi (medium) ~160dpi
  • hdpi (high) ~240dpi
  • xhdpi (extra-high) ~320dpi
  • xxhdpi (extra-extra-high) ~480dpi
  • xxxhdpi (extra-extra-extra-high) ~640dpi

Using desnity:

Nexus 5 is ~445 dpi => belong to xhdpi category.

Nexus S is ~233 dpi => belong to mdpi category.

So you can use layout-xhdpi directory for Nexus 5, and layout-mdpi directory for Nexus S.


UPDATE

Using dimensions:

Nexus 5 is 1080 x 1920 pixels. => layout-1080x1920 directory

Nexus S is 480 x 800 pixels. => layout-480x800 directory (or just the default one)

Upvotes: 1

Related Questions