One of the most initial significant changes to the environment and the interaction with the IDE, is the introduction of the AVD (Android Virtual Devices). After this SDK, to make it run an application in our emulator for the first time, we just need to use “Run as → Android Application”, then an Emulator instance will be opened and you can run the application there.
Now, first of all, we need to create, manually a “AVD”. Android Virtual Devices are configurations of emulator options that let you better model an actual device.
How to create a simple and default AVD:
You need to go the folder /tools inside the SDK directory. Here, you will find some new applications. First of all, we need to know the valid Android images we have in the SDK (platforms and addons). Using
android list targets (./android list targets if we are using GNU/Linux)
This will show the following list of available platforms.
Available Android targets:
id:1
Name: Android 1.1
Type: platform API
level: 2
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
id:2
Name: Android 1.5
Type: platform API
level: 3
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
id:3
Name: Google APIs
Type: add-on
Vendor: Google Inc.
Description: Android + Google APIs Based on Android 1.5 (API level 3)
Libraries: * com.google.android.maps (maps.jar) API for Google Maps
Skins: HVGA (default), HVGA-L, QVGA-P, HVGA-P, QVGA-L
Once we determine the image we are going to use, having a look to he information listed above, we choose a target and with the following line, we create the AVD
android create avd -n name_put_here -t 2
where the -t argument is the “id” of the target we are going to use. In this case I have put a “2”, this means that our AVD supports version 1.5. If we put a “1”, our device would be a “1.1 version device”.
After that, the system will ask you some question about customization of the device (hardware capabilities and so). The “no” option would let the device to “default” mode.
This AVD recently created, can be used in the IDE, when we want to run our application. Just as usually:
“Run as->Android Application” and then select the AVD (you can have more than one) to run the application on.