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?
问题:
回答1:
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
回答2:
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).