Back in mid-2010 you learned about common Android Virtual Device (AVD) configurations. We're now in tablet-crazed early-2011. In this quick tutorial, you'll extend your knowledge of AVDs by learning how to create configurations for two of the most popular Android tablets.
This tutorial directly continues from where the last tutorial, Common Android Virtual Device Configurations, left off. In fact, consider these steps to be after Step 6, but before Step 7 of that tutorial. You'll learn how to create appropriate AVDs for the popular Samsung Galaxy Tab and the widely anticipated Motorola Xoom tablet.
Step 0: Preparing Eclipse
If you haven't already, update your installation to include both the SDK Platform Android Honeycomb Preview and the GALAXY Tab add-on. To do this, go to the Android SDK and AVD Manager within Eclipse. On the Available Packages tab, find the Honeycomb Preview in the Android Repository list and the Samsung package within the Third party Add-ons list. The following figure shows what these look like. Install both of these items, as well as any pre-requisites they request.
Step 1: Creating an AVD to Emulate the Samsung Galaxy Tab
The Samsung Galaxy Tab was the first official Android tablet with the Android Market. As such, it is a popular target device for developers looking to target tablet users. Interestingly, the Galaxy Tab is also the first third-party device to show up with additional development content within the Android SDK and AVD Manager. This makes it somewhat simpler to create an AVD for. Please note that these steps require that you install the items from Step 0.
The important specs of this device, from an Emulator perspective, are:
- Target platform: Android 2.2, Galaxy Tab
- Screen Info: High Density, despite the fact that it's not, this is what it reports, WSVGA (1024x600)
- No keyboard
- Has dual cameras
Let's create an AVD configuration called GalaxyTab:
- Within Eclipse, launch the Android SDK and AVD Manager
- Select “Virtual Devices” from the left-hand options
- Click the “New” button to create a new AVD configuration
- Name the AVD: “GalaxyTab”
- Select the Target: “GALAXY Tab Addon (Samsung Electronics Co., Ltd.) - API Level 8”
- Input the SD Card Size: “2048 MiB” (or a suitable value for your uses)
- Keep the default Skin Details: “Default (GALAXY Tab)”
- Keep the default Hardware Property for Abstracted LCD Density: “240” (despite the real density being 170dpi)
- Also leave the rest of the default hardware properties alone
- Add a Hardware Property for Device ram size: “512”
- Save the AVD
This AVD will create the best depiction of the Galaxy Tab device. Note that the LCD density setting won't affect the look of the emulator on your screen. When launching the emulator in a sized window, it's only the actual pixel count of the target device that matters. The density settings affect what resources are loaded. As for why there’s some confusion over resolution/density configuration details, it stems from the fact that Samsung found that high density resources looked better on the tablet than medium density. This isn't surprising, seeing as how high density resources are usually larger and on the big, higher resolution screen you'd want larger resources.
Here are the details of the AVD:
And here's the AVD next to the actual tablet device:
Step 2: Creating an AVD to Emulate the Motorola Xoom Tablet
Although the Motorola Xoom hasn't shipped as of this writing, all of the specifications we need are readily available. As a launch device for Honeycomb, expectations are that it will be very close to the stock Android experience. This means the emulator will do a good job for most developers trying to port their apps for this device prior to its availability. However, as with any pre-release hardware, it is possible that the hardware or software details will change before release.
The important specifications for this device, from an Emulator perspective, are:
- Target platform: Android 3.0 Honeycomb
- Screen info: Medium density, extra large, WXGA (1280x800)
- No keyboard
- Dual camera support
Let's create an AVD configuration called MotorolaXoom:
- Within Eclipse, launch the Android SDK and AVD Manager
- Select “Virtual Devices” from the left-hand options
- Click the “New” button to create a new AVD configuration
- Name the AVD: “MotorolaXoom”
- Select the Target: Android Honeycomb (as of this writing, that's "Android Honeycomb (Preview) - API Level Honeycomb")
- Input the SD Card Size: “2048 MiB” (or a suitable value for your uses)
- Keep the default Skin Details: “Default (WXGA)”
- Keep the default Hardware Property for Abstracted LCD Density: “149” (this will come up as medium density)
- Add another Hardware Property for Device RAM size: “1024”
- Add another Hardware Property for Keyboard Support: “No”
- Add another Hardware Property for Camera Support: “Yes”
- You can fill in a few other properties, as found at Motorola's developer info site, see the screen shot below, too
- Save the AVD
This AVD will create, effectively, a preview depiction of the Motorola Xoom. When the final SDK comes out, the AVD can be updated with the edit option. The developer site, link above, also gives good information on the OpenGL support of the hardware.
This particular AVD, and any based on the Honeycomb Preview SDK, are surprisingly slow. Google says they're working on that in the preview notes. Let's wish them speed and luck on getting an update out that is much faster.
The following screenshot shows the details for this AVD:
And here's an image of the emulator next to the Nexus S, for scale:
Conclusion
You have now learned how to create reasonable AVDs for testing your applications on two surprisingly different Android tablets: the Galaxy Tab and the Motorola Xoom. Testing within an AVD is just the first step to tablet support. With the deviation in behavior from the emulators and the sluggishness of the current Honecomb Preview, you'll do well to test on the actual devices.
About the Authors
Mobile developers Lauren Darcey and Shane Conder have coauthored several books on Android development: an in-depth programming book entitled Android Wireless Application Development, Second Edition and Sams TeachYourself Android Application Development in 24 Hours. When not writing, they spend their time developing mobile software at their company and providing consulting services. They can be reached at via email to [email protected], via their blog at androidbook.blogspot.com, and on Twitter @androidwireless.
Comments