I have created 3 Device Descriptions that mimic the latest models of Samsung mobile devices (S2, S3 & S4). Although I enter the diagonal screen length and pixels (w x h), I am unable to see a change in density across the 3 AVDs when I start them using the AVD Manager (screen caps below). Did I miss something or does the tool support density changes? Also, this is poorly documented.
After a quit and re-enter, things worked fine but the density value never updated, always reads 320 - probably based on my laptops screen. Also DON'T use option 'Scale display to real size". Let the emulator do the rendering and move app to device for native testing.
Related
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.
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.
I am working on an android Audio Recording application, our app is currently designed to work on all android phones, the Nexus 7 and the Motorola Xoom tablets.
I was wondering if there are any guidelines or best practices to re-design/modify our app for Nexus 10. More specifically, any pointers on the below points would be really helpful:
UI guidelines to support the new 2560x1600 resolution
Android resource files related modifications (based on similar guidelines)
Any sample or open sources apps that have been modified to work on the nexus 10
Best practices creating and running a nexus 10 emulator since there is no such AVD device by default (screenshot below). Any thoughts on creating one, keeping the high resolution in mind.
As long as you have xhdpi assets, and layouts made for 10" tablets, you shouldn't have to do anything (except add a new xxhdpi launcher icon, as #Mattias mentioned).
To make a Nexus 10 AVD, navigate to Device Definitions:
Then, click New Device. Fill it out something like this:
Now it will be listed in the devices drop-down that you show above.
Regarding your second point, resources:
While the nexus 10 is a xhdpi device, it will use the launcher icon from xxhdpi "one bucket up" if available, so make sure to provide one as it will look much better/clearer/sharper. Reason is that there is room for a bigger icon on this device. Launcher icon size at xxhdpi is 144x144 pixels.
For reference see:
https://plus.google.com/118292708268361843293/posts/ePQya3KsTjW
The best way to emulate the Nexus 10 is to use AndroVM. I am currently running Android on it with the full Nexus 10 2560x1600 resolution and it fits onto my HD screen if I set AndroVM to use 320dpi.
Oh.. and it's VERY fast :-)
I personally use it over emulators and real hardware devices as it's extremely responsive and the deployment of the APK is lightning fast.
I do not contribute to the AndroVM project myself by the way, but it has speeded up my own development cycle considerably. In all development cycles, a developer waiting to see if their code tweaks work using an emulator or a hardware device adds considerable time overhead. I would thoroughly recommend using AndroVM regardless of screen size during normal code development.
How do I set up emulator for specific android device? I mean how to properly get Abstracted screen density and screen size? Is there any online resource which can provide info about these constants?
Ya, Google it for your answer.
This link here have a few common phones.
See if it matches your needs.
http://mobile.tutsplus.com/tutorials/android/common-android-virtual-device-configurations/
In this wiki page, you can get some resolution and density.
For example, samsung phones:
http://en.wikipedia.org/wiki/List_of_displays_by_pixel_density#Samsung
Yes, it's called Google and math:)
Goole the name of your target device. Get its specs, resolution width and height and screen size. Then the density, which is expressed in dots(pixels) per inch is obtained by simply calculating the total number of pixels for the given screen size and reporting that to one square inch.
At any rate, don't get your hopes high about using the emulator to actually (realistically) simulate real devices. The emulator is slow as hell (to the point where a blank OpenGL surface will be drawn at 2 FPS). Your best bet is to get the actual physical device you need. Second best is to use Android x86 though that one has other issues (but runs generally faster than the default emulator).
I'm trying to create an ADT layout configuration to match an EVO 4G screen, with its 800x480 resolution and 4.3" screen. The emulator I created by just specifying WVGA800 in the SDK Manager seems to match my physical EVO device perfectly.
However, when I try to create a Layout device config (the one you select when you edit an XML view), I can't match it at all, no matter the values I've tried so far. The default configuration only includes a 3.7" and then jumps to 5.1" (whaaa, why did ADT devs think 4.3" screens weren't important enough?). OK, so I make a custom one, but no matter what values I try, I can't match the emulator size.
Does anyone know what the exact values I must put in to the layout config for it to match 100%? x dpi, y dpi? Values I found online end up not matching the right size. It looks like the Density needs to be set to High, and Screen Ratio and Screen Size don't matter.
Thank you.
Artem - I have the same phone, and the same problem as you. I played around a bit, and I found that setting the x and y dpis to 250 is a pretty good match (with dpi set to "high density"). I doubt it is 100%, but it is close enough for me for now.
If anyone else has found a better value, please post it.