Resolution disparity when emulating device on chrome - android

According to Chiptrolls, these are specifications of Galaxy M31:
6.40-inch display( 1080x2340 pixels) with an aspect ratio of 19.5:9
If I add this device using the specifications to my chrome device emulator (1080x2340), it doesn't match with my real device screen, actually the resolution that I found was (420x860).
Is it a bug?
Do I need to use some calculation?
My smartphone isn't a super wide screen tv full hd:
https://www.chiptrolls.com/specs/Samsung-Galaxy-M31/2951#.YuhOSNJKjio

Related

How to set a tablet device dimensions on a web browser

I am using flutter for developing an android app optimised (from frontend layout perspective) for a specific tablet (Galaxy tab A8).
Specs for tablet are -
Resolution: 1920x1080, 16:10 ratio (216 ppi density)
Dimensions: 9.72 inches x 6.37 inches
The issue is that I do not have the tablet physically and my machine is too low powered to run an emulator hence I need to rely on the chrome/web for development.
Now when I try to use the chrome dev tools and and plug in the resolution in the responsive settings, the screen I get has way more space than the actual device and hence I am not able to optimise specifically for that device.
I think the device dimensions has something to do with this issue but there is no option to set the dimensions for the browser window. How do I set the resolution in chrome dev tool so that it matches my device. Is there any conversion factor?

Why is there a discrepancy between Android display dp values on physical device and emulator

I have a Flutter app targeting Android.
I am testing on Samsung Galaxy A32 5G. Phone display spec is:
Display Size: 6.5 inches, 102.0 cm2 (~81.6% screen-to-body ratio)
Resolution: 720 x 1600 pixels, 20:9 ratio (~270 ppi density)
I use below code to determine the screen size and I change fonts sizes and other parameters based on this:
MediaQuery.maybeOf(context)?.size.width
MediaQuery.maybeOf(context)?.size.height
When I run above code on a physical phone I get these dp values for width and height:
360 x 752
When I create an emulator using the same screen spec I get these values:
480 x 1050
This is a very large discrepancy. The physical device is returning values for a very small phone and indeed things look very small on screen. Phone was factory reset so it is not any user defined settings.
App looks great on the emulator, but really bad on the real device. I am now thinking the testing I've done using emulators is meaningless.
What is going on here?
The screen size that you see on simulator is not the exact size of the device.. In the options you can change settings to set the simulator exactly as required. Please check the attached image

What is the real size of mobile devices?

I want to write css to devices. In the devtools Galaxy S5 for example say the size is 360x640.
But according to screensiz website Galaxy S5 is 480x800.
Which of them is correct?
A mobile phone's screen size is not necessarily the same as it's web browser viewport size. You should design your website based on the browser viewport and not on the actual pixel size.
You can read some more about this, as well as find the viewport size for many devices here.

Android Studio virtual device display does not match real display (Galaxy Note 2)

I'm developing an app, which is reported to display wrong (have screenshot evidence) on Samsung Galaxy Note II (http://www.gsmarena.com/samsung_galaxy_note_ii_n7100-4854.php). I've tried to create virtual device with 720x1280 (5.5") display, but it just shows much larger emulated display on my PC (compared to Nexus 5.5 virtual device) and app elements are layed out correctly. Why I cant get same results as on real device? Or how do I do it?
The density of your computers screen does not match the density of a current phone. The emulated display size will always be bigger for such high resolution emulators. This should not be a problem as you already found out that the layout is working correctly.

why the emulators have different sizes than the mentioned ones

Why some devices are for example 2.7 inches and when you launch the emulator the real size is not 2.7 inches..?
Edit:
And will the display on that screen be like the real display or will it differ on real devices?
You can start the emulator to have the same number of pixels or to have the same size as the real device. You cannot have both since the density of your screen in general differs from the density of the device.
If you specify to have the same size and the actual size still differs, then your OS did not correctly recognize the density of your screen.
The density of the screen on the development machine is normally lower than the one of the device. A pixel perfect emulation of the device screen will therefore only be achieved when you choose the same pixel size. But then, the emulation is very good since the emulator runs the same code and operating system as the real device.
This you can set while launching the emulator. You will get an option of scaling display to real size but that will appear very small on your computer screen. So better use the default size which fits to the screen.

Categories

Resources