We're trying to emulate devices with the new density of 320 dpi in Android 2.3 - such as Archos 101, and we can't seem to be able to define an emulator with such density, even after downloading the latest 2.3 sdk.
I would really appreciate some ideas on this one :)
Many thanks!
If you are using Eclipse go to Window - Android SDK and AVD Manager , there hit the New button, enter a name and select the SDK version, hit the Resolution option down in the Skin section and set the resolution you need.
You can get info on the display from the DisplayMetrics struct: DisplayMetrics metrics = getResources(). getDisplayMetrics(); Though Android doesn't use a direct pixel mapping, it uses a handful of quantized Density Independent Pixel values then scales to the actual screen size.
Here's what we recommend: 3GB RAM: 410 DPI. 4GB RAM and above: 480 DPI.
The first pitfall you must avoid is using pixels to define distances or sizes. Defining dimensions with pixels is a problem because different screens have different pixel densities, so the same number of pixels may correspond to different physical sizes on different devices.
That is quite simple.
Modify the attribute hw.lcd.density=320
at avd config file: /Users/yourUserName/.android/avd/CustomDevice_API_19.avd/config.ini
, and reboot your virtual device. I'm already test it, and it works to me!
Warnning: Make sure you set the correct density, otherwise you will receive an error: qemu: available lcd densities are: 120, 160, 213, 240, 280, 320, 360, 400, 420, 480, 560, 640
BTW my Android SDK Tools version is 25.2.5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With