Testing for Custom Resolutions and Screen Sizes

One of the advantages of using an AVD to evaluate devices is the ability to define arbitrary screen resolutions and pixel densities.

Figure 4-5 shows a new AVD for a 1024x768 device with a pixel density of 240dpi.

FIGURE 4-5

When you start a new AVD you will be presented with the Launch Options dialog shown in Figure 4-6. If you check the "Scale display to real size'' checkbox and specify a screen size for your virtual device, as well as the dpi of your development monitor, the emulator will scale to approximate the physical size and pixel density you specified.

This lets you evaluate your UI against a variety of screen sizes and pixel densities as well as resolutions and skins. This is an ideal way to see how your application will appear on a small, high-resolution phone or a large, low resolution tablet.

CREATING AND USING MENUS

Menus offer a way to expose application functions without sacrificing valuable screen space. Each Activity can specify its own menu that's displayed when the device's menu button is pressed.

Android also supports context menus that can be assigned to any View. Context menus are normally triggered when a user holds the middle D-pad button, depresses the trackball, or long-presses the touchscreen for around three seconds when the View has focus.

Activity and context menus support submenus, checkboxes, radio buttons, shortcut keys, and icons.

FIGURE 4-6
Mobile Apps Made Easy

Mobile Apps Made Easy

Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.

Get My Free Training Guide


Post a comment