Pages

Saturday 13 October 2012

Beginning Android - Launching the Android Virtual Device

An Android Virtual Device (AVD) is a device configuration that is run within the Android emulator. It works with the emulator to provide a virtual device-specific environment in which to install and run Android apps. This tutorial shows you how to launch the previously created AVD via the Android SDK’s AVD Manager tool.

Using AVD Manager to Launch an AVD

Assuming that you’ve created MyAVD, you’ll want to launch this AVD with the emulator. Begin by running the Android SDK’s AVD Manager tool, or run SDK Manager and select Manage AVDs from the Tools menu. You should see an Android Virtual Device Manager window that’s similar to Figure
 
 
Android Virtual Device Manager presents a list of previously created AVDs, of which there is only MyAVD in Figure. Highlight this AVD, which enables the Start button, and click this button to begin the process of launching MyAVD. Figure shows you the resulting Launch Options dialog box.
 
 
As well as identifying the skin and screen density of the AVD that’s about to be launched, Launch Options presents the following checkboxes:
  • Scale display to real size causes the resolution of the emulator’s display to be scaled to match the screen size (in terms of inches and dots per inch) of the physical Android device being emulated, when checked.
  • Wipe user data causes the AVD’s user-data partition to be deleted, when checked. (The emulated device preserves apps and state data across AVD restarts in a user- data partition. You might occasionally need to delete this partition while developing and testing an app, and you do so by checking Wipe user data.)
  • Launch from snapshot causes the emulated device to be started from a previously saved snapshot of the device’s state, when checked. This checkbox defaults to being checked for an AVD created with snapshot enabled.
  • Save to snapshot causes the emulated device’s state to be saved to a snapshot upon device exit, when checked. This checkbox defaults to being checked for an AVD created with snapshot enabled.
The final two checkboxes refer to a snapshot, which is a stored file of emulator state. The emulator launches much faster when launched from a snapshot.

Keep the settings that are shown in Figure and click the Launch button. On a Windows XP platform, you will see a few command windows flash by and then you’ll see Figure emulator window.


Figure shows the emulator window with 5554:MyAVD in its titlebar. Value 5554 identifies a console port that you can use to query and control the AVD’s environment. Android supports a maximum of 16 concurrently executing AVDs, where each AVD is assigned an even-numbered port number that starts at 5554. (A discussion of the console is outside the scope of this lesson.)
Figure also shows that the emulator window consists of a device screen on the left and phone controls/keyboard on the right. The device screen initially displays “A N D R O I D _”, and then displays the graphical logo shown in Figure while the Android platform associated with the AVD is initializing.


The graphical ANDROID logo has an animated shimmer effect.

After several minutes, this logo is replaced with the home screen that’s shown


The home screen is a special app that displays a wallpaper background. A statusbar appears above the home screen (and every app screen), presenting access to notifications, the amount of battery power that’s remaining, the current time, and other information.
The home screen can display widgets, which are miniature app views that can be embedded in this screen or the screen of any other app. Figure reveals the Google Search widget near the top of the home screen.

No comments:

Post a Comment