Testing Devices – Emulator Settings for each Android Density Bucket

Recently I’ve needed to test on a vast range of devices, but we don’t have the physical devices available. I’m always wary of the emulators because they can’t show defects with the software that manufacturers/operators put on top of vanilla android. One thing the emulators are good for is testing the different pixel densities that devices can range in as well as portrait/landscape with these densities.

I’ve already started making a list of devices that will fall into these buckets: see here. and below is a list of different emulator setups to try and catch any bugs that may appear in one specific density.

You can create new virtual devices (emulators) using the Android AVD Manager. This tool is accessible in eclipse / intellij and through the android_sdk/tools folder. Below is how you’ll be creating them.

android virtual device manager

Android LDPI: ( HTC Wildfire )

Target: Google APIs (Google Inc) - API Level 8
SD Card: 
  size: 512mb
Skin: 
  Built In: QVGA
Hardware:
  Abstracted LCD Density: 120

Android MDPI: ( Samsung Galaxy Ace )

Target: Google APIs (Google Inc) - API Level 8
SD Card: 
  size: 512mb
Skin: 
  Built In: HVGA
Hardware:
  Abstracted LCD Density: 160

Android HDPI: ( Google Nexus One )

Target: Google APIs (Google Inc) - API Level 9
SD Card: 
  size: 512mb
Skin: 
  Built In: Default (WVGA800)
Hardware:
  Abstracted LCD Density: 240

Android XHDPI: ( Samsung Galaxy S III )

Target: Google APIs (Google Inc) - API Level 15
SD Card: 
  size: 1024mb
Skin: 
  Built In: WXGA720
Hardware:
  Abstracted LCD Density: 320
  VM application heap size: 48 
  Device ram size: 1024

The main point is the Abstracted LCD Density, this represents the DPI of the device. If you set this correctly your device will have that density of screen.

  • 120 = LDPI
  • 160 = MDPI
  • 240 = HDPI
  • 320 = XHDPI

Footnote:

The reference above ( device ) to what device this is, isn’t saying that the emulator will act the same as that device, it’s just saying it is representative of the screen density for this device.

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

4 thoughts on “Testing Devices – Emulator Settings for each Android Density Bucket

  1. Hi

    I was wondering — these are great for AVD — but what about in the Graphical Layout Editor itself? You can create “custom devices” in there and I’ve been pulling my hair out for a “custom device” profile for the S3 for the Graphical Layout Editor in Eclipse… any ideas there?

    Jordan