Advertisement
Android SDK

Android Tablet Virtual Device Configurations

by

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.

Tablet AVD - Figure 1

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:

  1. Within Eclipse, launch the Android SDK and AVD Manager
  2. Select “Virtual Devices” from the left-hand options
  3. Click the “New” button to create a new AVD configuration
  4. Name the AVD: “GalaxyTab”
  5. Select the Target: “GALAXY Tab Addon (Samsung Electronics Co., Ltd.) - API Level 8”
  6. Input the SD Card Size: “2048 MiB” (or a suitable value for your uses)
  7. Keep the default Skin Details: “Default (GALAXY Tab)”
  8. Keep the default Hardware Property for Abstracted LCD Density: “240” (despite the real density being 170dpi)
  9. Also leave the rest of the default hardware properties alone
  10. Add a Hardware Property for Device ram size: “512”
  11. 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:

Tablet AVD - Figure 2

And here's the AVD next to the actual tablet device:

Tablet AVD - Figure 3

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:

  1. Within Eclipse, launch the Android SDK and AVD Manager
  2. Select “Virtual Devices” from the left-hand options
  3. Click the “New” button to create a new AVD configuration
  4. Name the AVD: “MotorolaXoom”
  5. Select the Target: Android Honeycomb (as of this writing, that's "Android Honeycomb (Preview) - API Level Honeycomb")
  6. Input the SD Card Size: “2048 MiB” (or a suitable value for your uses)
  7. Keep the default Skin Details: “Default (WXGA)”
  8. Keep the default Hardware Property for Abstracted LCD Density: “149” (this will come up as medium density)
  9. Add another Hardware Property for Device RAM size: “1024”
  10. Add another Hardware Property for Keyboard Support: “No”
  11. Add another Hardware Property for Camera Support: “Yes”
  12. You can fill in a few other properties, as found at Motorola's developer info site, see the screen shot below, too
  13. 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:

Tablet AVD - Figure 4

And here's an image of the emulator next to the Nexus S, for scale:

Tablet AVD - Figure 5

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 androidwirelessdev+mt@gmail.com, via their blog at androidbook.blogspot.com, and on Twitter @androidwireless.

Need More Help Writing Android Apps? Check out our Latest Books and Resources!

Buy Android Wireless Application Development, 2nd Edition  Buy Sam's Teach Yourself Android Application Development in 24 Hours  Mamlambo code at Code Canyon

Related Posts
  • Code
    Android SDK
    Integrating Google Play Services on Android85ude preview image@2x
    By integrating your Android apps with Google Play Services, you can access Google services, such as Maps, Drive, and Google+. In this tutorial, we will go through the process of integrating Google Play Services with Android apps.Read More…
  • Code
    News
    Android 2013: A Year in Review and 2014 PredictionsPk45fe preview image@2x
    It was another strong and, may I say, dominant year for the Android platform. It continued to dominate in market share and climb in numbers. Countless devices were released featuring the popular, mobile operating system and not all of those devices were smartphones or tablets. Android is making headway in new territories. 2013 was a busy year for the green robot. Now that the year has come to a close, it's time to recap the action.Read More…
  • Code
    Android SDK
    Android SDK: SamplesAndroid preview@2x
    In this series, we have been exploring the basics of Android development. We have looked at what you need to know when building the elements in Android apps. In this tutorial, however, you will see that the Android platform provides resources you can learn from. The samples of the Android SDK include complete applications in which you can see functioning examples of typical Android application components. You can use the samples in more than one way, including directly from within Eclipse.Read More…
  • Code
    Android SDK
    Android SDK: Running & DebuggingAndroid preview@2x
    We have been learning how to develop Android apps in this series. In the last tutorial, we looked at connecting hardware and virtual devices to Eclipse. In this tutorial, we will explore running and debugging apps on physical devices and AVDs from Eclipse.Read More…
  • Code
    Android SDK
    Android SDK: Virtual & Physical DevicesAndroid preview@2x
    We are learning about Android app development in this series. We already looked at the basic elements in an Android project and touched on user interface design and data storage along the way. In this tutorial, we are going to explore how to run and interact with your apps on physical and virtual devices. In the next part of the series, we will work through the process of running an app on a physical device and on the emulator. In this part, we'll look at getting our physical and virtual devices set up in Eclipse.Read More…
  • Code
    Android SDK
    Android SDK RequirementsAndroid preview@2x
    This is the first in our Learn Android SDK From Scratch series! In this tutorial you will learn about the requirements necessary to get up and running with the Android SDK!Read More…