How to start Android Virtual Device and run an Android application in it

Before going through this post, please read my previous post on Android that explains how to create an Android application from eclipse.

To run an Android project using Android Virtual Device, you first need to launch the Android Virtual Device Manager inside the eclipse IDE. See the below screenshot to know where the Android Virtual Device Manager is located.

Launchung Android Virtual Device Manager


After clicking on the icon, the Android Virtual Device manager will get opened. It contains two tabs; one is Android Virtual Devices which shows all the created Android Virtual Devices and allows user to define a new one. The other tab is Device Definitions which shows some predefined Android Virtual Device definition. You can choose one from them to create the Android Emulator or you can define a new one. The choice is up to you. See the below screenshots for more details.

Android Virtual Device Manager.Tab1

Android Virtual Device Manager.Tab2



In both case, the newly created devices will be visible inside the listview of the first tab. Select one of them and click Edit to see its details.

a demo virtual device definition


Or select one of them and then click Start, then Launch to start the emulator. The Virtual Device takes some time (1-2 minutes) to start. When it is started, tap and then drag the lock to unlock it. See the below screenshot of Nexus S Android Virtual Device. Close the device manager. You can keep the virtual device opened as long as you wish.

Nexus S Android virtual device homepage



your Android Virtual Device is now Ready and you can run your applications in it. To do that, right click on the project name and then choose Run As and click on Android Application. Bring your device manager to the front and see the output.

application running demo on android virtual device


Your application is now installed in the device. You can see it in the apps list. To do that, press the back button and then , on the home screen, click on apps icon.

apps screen on android virtual device


In my next post I have written how to run an Android application using a real Android device and how to minimize some common problems while running android application.