android emulator for google nexus 7? - android

I would like to set up android emulator which will be simulate the device google nexus 7. It has got 7 inches display and resolution 1280x800.
What the number is properly value for monitor dpi? Is this value equivalent of abstracted LCD density in the hardware part?

Here is a answer for others with similar obscurities about properly settings of a display in android emulator.
So I set abstracted LCD density to value 213. It is the default value of Nexus 7. Because of this value nexus is not able shows full tablet mode. This value is specific for every device.
Next I set resolution to 1280x800 and save it. Then I click on start emulator and set next values about monitor.
I use 15.4 inches monitor with resolution 1680x1050 px. Firstly I set screen size of tablet (7 inches) and then monitor dpi. When you click on the question mark, it will show you new window with the screen size and resolution. These values are values of your pc monitor. When you fill these values, it compute your monitor dpi. For me it is 129. And finally I start emulator.

Related

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

how to choose an android emulator that match real device

I have created an app that works on 10.1 inch tablet. Later I get a 7 inch one and that need some change to adjust for font size ( font as big as in a big screen and also a smaller screen). Now I get a RedMi note phone that is 5.5 inch. The app looks badly and needs big change of the UI screen. What are the best way to adjust for such changes in screen size and resolution?
Also, how should I create an emulator that meet the real device resolution and screen size? How should I pick when there are no one nexus device that match it completely?
Thanks
Please consider the layout, layout-large, layout-xlarge for making all screen compatibility application.
For example,
layout - Mobile screen
layout-large - Tablet below 7 inch
large-xlarge - Tablet above 7 inch
refer this link for more details http://developer.android.com/guide/practices/screens_support.html
For creating the new emulator device, Goto eclipse and
Window->Android virtual device manager->Device defination(tab)->Select device->Create device-> restart the eclipse
The you can see the created device.

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.

Will samsung GS 4 be a Large or Normal sized device for Android layout purposes?

The upcoming Samsung Galaxy S4.
Reported Specs:
1080 x 1920
4.99 inch diagonal
If I plug that into a new Device definition in AVD, the resulting device size is listed as "Normal" and the Density as "xxhdpi", screen ratio long.
However if I put in a diagonal of 5.00 inches the size changes to "Large".
What to tust?
More generally: Does the AVD device manager match exactly the logic used on Android devices in determining what layout bucket to pull from (unless manufacturer overrides)?
Edit: note regarding the above sentence: When you enter the diagonal and screen dimensions the AVD dropdowns will automatically configure themselves according to those values.
And please oh please don't direct me to the dreaded "Supporting Multiple Screens" page which does not give exact logic.
Will samsung GS 4 be a Large or Normal sized device for Android layout purposes?
You will know when everybody else knows, when the device ships. Samsung can choose whatever it wants for the screen size.
Does the AVD device manager match exactly the logic used on Android devices in determining what layout bucket to pull from (unless manufacturer overrides)?
No, the "AVD device manager" uses whatever screen size bucket you chose when you created the device definition. There is a drop-down listing the various choices.

Android display differences between WXGA with Nexus 7

I have a Nexus 7 tablet which should have a resolution of 1280px by 800px (WXGA). I develop on Eclipse and my layout is set to display at WXGA. Then, I can place my button and object and choose their size according to what I see on the Eclipse display. The problem is that what I see in Eclipse is very different from the display on the tablet. Everything is much bigger on the tablet and it causes me a lot of troubles.
I wonder if someone have an idea about this?
Edit
For some reason it seems like the 7inch WSVGA is the exact replication of my Nexus 7 screen. It is strange since it offers only 964×544 pixels while the Nexus 7 should give 1280x800
WXGA means nothing by itself. You should look at the density too. Nexus 7 is 213dpi (tvdpi) while a Galaxy Nexus is the same res but 240dpi (hdpi).
You should try to detect the screen size that the Android device has and then run code to re-position screen elements accordingly
In Unity scripting you would get the vars Screen.Width and Screen.Height , I'm not sure what the vars are called in normal android , but you would then set your screen elements to react to what ever size the screen it .

Categories

Resources