In our previous post Setting Up your PC for Developing Android Applications, we have learned how we can set up Eclipse IDE to develop Android applications but there is one last step that we need to do before we can move ahead and start developing Android applications. It is configuring the Android Virtual Device (AVD) also known as Emulator. AVD is an emulator configuration that will let you model an actual device by defining the hardware and the software options to be emulated by the Android Emulator. It can mimic an Android Smartphone, e-reader or tablet to allow you to test your Android Application alternatively you can test your Android application on a physical device if you have one. However having an emulator is very much needed as it is handy to run an application on a single click than constantly uploading the latest version of the application into your physical device.
To learn more about AVD, visit android official documentation page for AVD.
While discussing in our previous post we have said that Google Android Tool Kit bundle also contains the latest Android system Image for Emulator. So, essentially it implies that now you can emulate your Virtual device running on latest Android platform without downloading any additional package but if you wish to emulate any other version of Android you will need to download the system image for that version.
Configuring Step by Step
1) Open up Eclipse and Select “Android Virtual Device Manager” either from “Window” menu or by the small virtual device icon on your toolbar.
2) It will open up the Android Virtual Device Manager window, Select New option appearing on the right and it will open you the Device configurations window. Provide the below details to create Nexus 4 & Nexus 7 emulators.
Note: Do not select Snapshot option without selecting Use host GPU as snapshots are not supported without host GPU. Check both or Uncheck both.
3) Please note that above configuration uses 1 GB of your RAM and 32 MB of your Heap Memory. If you are running on a PC with lower configuration RAM then Virtual device may fail and that’s the warning that is being displayed just above the OK button. If you are facing any troubles then try decreasing the RAM size in multiples of 128MB in configuration and see if it is working.
1) What is the “Target” in Android Virtual Device Configuration ?
The “Target” defines the version on which you want your Emulator to be configured. As discussed earlier you will need to have Android System Image of the targeted version to be available to display the different version of the Android in the “Target” drop down menu.
2) What is CPU/ABI and Which CPU/ABI I should use ?
The CPU/ABI stands for Central Processing Unit / Application Binary Interface and is one of the hardware properties of the physical device that you are emulating. As per actual standards of quality you have to test your application in every architecture but in general you can select ARM architecture as most of the devices(90%) are running on ARM architecture with Mips and Intel Atom taking rest of the share.
3) What is RAM and VM Heap ?
RAM stands for Random Access Memory and VM stands for Virtual Machine. They are the hardware properties of the emulated device where RAM Memory holds application memory while the application is being processed and Virtual Machine Heap holds the object data that application is using in its context.
I believe every other option in the definitions are self explanatory but if you have any queries please comment below and don’t forget to share if you like it.