How to create seperate values folder for Samsung Galaxy note plus and Google Pixel XL3 in Android Studio

188 views Asked by At

I am creating to show virtual card swipe view for left to right and right to left. so, am trying to give common width & height(xxxhdpi-values dimen.xml) for below mentioned mobiles in Android UI part.

Samsung Galaxy note plus 6.8 inch, 1440*3040 , 498 PPI.

Google Pixel XL3 Android Mobiles. 6.3 inch, 1440w*2960h , 523 ppi density.

both detecting xxxhdpi values folder. so, If I given common width dp values. then, both screen design showing different card UI alignment. UI is not properly fit with the screen in both devices.

so, If I am trying to adjust Samsung device, google pixel design will get collapse/not fit.

so, am thinking, this is the good solution one like I want to create separate values folder for this two devices.

very long back, I have this solution. please find the link below:

How to Create Seperate Values folder Sony Xperia Z1 in android

Ex: I tried for this Samsung: (its detecting in xxxhdpi-values folder(640dpi)). dp=px/(dpi/160) so, dp = 1440/(640/160)=360 . so, I we got values-sw360dp. Exactly, I dont know, this method is correct or not, nowadays.

I referred this links also. but, still am not clear idea.

Different values folders in android

How to define dimens.xml for every different screen size in android?

can anyone please help/suggest any alternate/better solution on this UI issue. It maybe help for more android developers also.

Thanks Advance.

Reference: support different pixel density:

https://developer.android.com/training/multiscreen/screendensities

ldpi Resources for low-density (ldpi) screens (~120dpi).

mdpi Resources for medium-density (mdpi) screens (~160dpi). (This is the baseline density.)

hdpi Resources for high-density (hdpi) screens (~240dpi).

xhdpi Resources for extra-high-density (xhdpi) screens (~320dpi).

xxhdpi Resources for extra-extra-high-density (xxhdpi) screens (~480dpi).

xxxhdpi Resources for extra-extra-extra-high-density (xxxhdpi) uses (~640dpi).

0

There are 0 answers