I am trying to create an application that I want to run on both Samsung Galaxy S3 and the Nexus One. But later I came to know that both the devices comes in the normal screen size. How can I make the layouts that fits both the devices?
What type of folders should be created and any entry in the menifest for that folders..?
Samsung galaxy s3 - 4.8 inches(Normal screen)
Resolution - 720 * 1280
XHDPI
And
Nexus one -
3.7 inches(Normal)
480 * 800
HDPI
A single layout(normal) should be fine for both the devices . You can create different set of images for both as one is hdpi and other is xhdpi.
Edit : Adding the example table
MDPI X Large 10.1 inches 1280w * 800h(landscape) Samsung Tablet
MDPI Large 7 inches 1024h * 600w HTC Flyer
MDPI Large 7 inches 976h * 600 w Samsung GT P6620
Related
I have added one splash screen image(1440 X 2560) in background. When I run the app, I see the image as stretched for the Samsung S8(All xxx devices).
Samsung Galaxy S7 resolution: 1440 x 2560 - XXXHDPI
Samsung Galaxy S8 resolution: 1440 x 2960 - XXXHDPI
The issue is if I am adding image(1440 X 2960) in a drawable-xxxhdpi folder, then image will be compressed for Samsung S7, and if I am adding image(1440 X 2560) in a drawable-xxxhdpi folder, the things will be bad in Samsung S8 device.
Is there any way through which we can manage the different images in our resources folder for different XXXHDPI devices?
I tried my way and it worked, try to create a drawable-long-xxxhdpi folder in res and put the 1440x2960 pixel image there. Hopefully can
Samsung Galaxy s6 has a screen density of 577 ppi which maps to xxhdpi - xxxhdpi
Screen resolution: 1440 X 2560
Samsung Galaxy S3 has a screen density of 306 ppi which maps to xhdpi
Screen resolution: 720 X 1280
My app with a lot of scenic images was developed against xhdpi-devices (i.e. S3)
but to have margins against the future the images has a resolution of:
Image resolution: 1300 X 1950
So - what happends with images with this resolution when put in a xxxhdpi device such as Galaxy S6? I compiled the app against an S6 and cannot see any
difference. Is this because the images are in the xhdpi-folder and s6 thanks to
this does not use the full density of 577 ppi? My theory - IF it have used the
full capacity - the images whould have been stretched out since the width is 1300 px and the screenwidht of S6 is 1440.
Greatful for answers
EDIT: the images uses the whole screenwidth.
I need info about under which dpis both Samsung Galaxy s5 and Samsung note 4 like do they come under xxhdpi or xhdpi or hdpi ?
S5 :
xxhdpi (~432 ppi pixel density)
note 4 :
technically it is DENSITY_560 since it has ~515 ppi pixel density ,
but you should target xxxhdpi and let the android resources system scale images down for you like the nexus 6
I have developed a clock widget. And I only have 1 res/layout and 1 res/drawable. Everything works perfectly.
It works on mdpi like Samsung Galaxy Ace. It works on hdpi like Samsung Galaxy S2. It works on xhdpi like Samsung Galaxy Note.
However I got ugly look on 720x1280 devices such as Samsung Galaxy Nexus or Sony Xperia S. And coming soon Samsung Galaxy S3.
When I provide res/layout/xhdpi which I built specifically for 720x1280 devices and then Galaxy Note will also use this layout and it looks ugly on Galaxy Note.
How to address this issue?
It is like some crossing between 720x1280 (Galaxy Nexus, Sony Xperia S, Galaxy S3) and 800x1280 (Galaxy Note).
The resolution and DPI of the device don't necessarily match up (high resolution doesn't mean high DPI). DPI is a ratio of the resolution of the device and its physical dimensions.
Instead of separating your layout folders by DPI, separate them by dimensions. For instance, layout-large, layout-xlarge. You can also quantify by specific sizes, such as layout-w720-h1280, in which case that would match only device with a minimum width of 720 pixels and minimum height of 1280 pixels.
Use layout-sw320dp for Galaxy S3
I have Galaxy tab 10.1 inch and I have made app and test on it, it works fine.
Now my question is will this app work on Galaxy 7 inch, Galaxy 7.7 inch, Galaxy note and Galaxy 8.9 inch
here is the details of these devices:
(My Device) Galaxy tab 10.1 inch --> 800 x 1280 pixels, 10.1 inches (~149 ppi pixel density)
Galaxy 8.9 inch--> 800 x 1280 pixels, 8.9 inches (~170 ppi pixel density)
Galaxy 7.7 inch --> 800 x 1280 pixels, 7.7 inches (~196 ppi pixel density)
Galaxy 7 inch --> 600 x 1024 pixels, 7.0 inches (~170 ppi pixel density)
Galaxy Note --> 800 x 1280 pixels, 5.3 inches (~285 ppi pixel density)
Please tell me for which device I have to make layouts again and what will be the folder names for drawable and layout
for Galaxy 7 inch --> 600 x 1024 pixels, 7.0 inches (~170 ppi pixel density) you can make layout folder with name "layout-large-mdpi-1024x600"....but for other device i am also unable to sort correct
As long as you are using relative layout mechanisms, it wil be ok. If you want to test it yourself, you can start your application in emulators using different screen sizes. There is also a Galaxy Tab Emulator.
read
Multiple Screen Resolution Support
Found answer myself: In order to support maximum devices, we can try to make a general layout which fits for all device, there may be minor trade offs, but one can live with that. We can make such a layout by using Relative Layout as much as possible, if there comes a situation where you can not handle multiple device support, we can try handling it with code at run time, but in such a manner, that it runs on all device.
complete answer is here
Layout for 720*1280 devices