Noterezeck
Noterezeck

Reputation: 422

Support different resolution, but on the same screen size

The same screen size, for example 10' can have different resolution: 1280x800 and 2560x1800. This way, both devices fit the sw720 and get the dimens from dimens-sw720 folder, but this way the views are either too big on the smaller device and normal on the bigger device, or normal on the small device and too small on the bigger device. How do I make the app tell the difference between both screens so they use different dimens? If xlarge-mdpi and xlarge-xhdpi are used instead of sw-720, this screws up the views on a 5.5' device I have here (not sure if that happens to all 5.5' devices).

I already spent a good chunk of my time looking for an answer here, rereading the documentation and consulting with other devs, but so far no one was able to give me an answer. One of the answers here says that if the screens are the same size, but the resolution is different and I've used dp, the view should be fine on both devices, but that's not the case here. These are the questions I went through and followed every related questions to them: Q1, Q2, Q3, Q4 and ofc the main documentation link, which contains links to more detailed information about supporting different screen resolutions. Am I missing something here?

Upvotes: 3

Views: 558

Answers (1)

Khemraj Sharma
Khemraj Sharma

Reputation: 58934

I also faced this issue before 6 months. I ended up with this sdp library. This library made it very simple to make app responsive for all screens.

And what you have to do is just use like _10sdp instead of 10dp. That's all!

enter image description here

Add this library to your gradle.

dependencies {
  implementation 'com.intuit.sdp:sdp-android:1.0.5'
}

Upvotes: 1

Related Questions