Thursday, December 29, 2011

Creating and Running Android Emulator from Eclipse


Emulators are good to test our android project when there is no device available with us. Emulator will emulate the actual android operating system but with certain limitations. How do we create and run them?

Am gonna write in detail about creating and running emulator from eclipse. If you have already installed ADT plugin in eclipse (if not see my post http://coffeewithtechie.blogspot.com/2011/12/install-and-configure-android-in.html) you must see AVD Manager under Windows menu.

1.       Click on the AVD Manager to open Android Virtual Device (AVD) Manager Window.




2.       Click on New button. It opens AVD creator window similar to the image below.

3.       Type in the Name for your emulator.
4.       Select the Android version you are going to target for your emulator, when you click on target dropdown it gives you a list of available sdk’s from your system to select. Choose anyone and proceed to next field.     
                

5.       CPU/ABI option is disabled by default, but when you select target sdk, it gets filled with the cpu associated with that sdk, usually (ARM(armeabi)).

6.       Specify the size of your sd card to be created for your emulator. Value must be integer eg, 1024 and you can select any one of the units (KiB, MiB, GiB) from the dropdown next to it. Skip the file option.

7.       If you want to take snapshot from your emulator check snapshot enable option. Am gonna leave unchecked for this post.

8.       Size determines the size of your emulator to be created in pixels. Either you can choose from built in size options which corresponds to real device screen sizes, else if you want bigger or smaller than that, always feel free to choose Resolution option and enter your own width and height. Built in size options varies based on the target platform selected. See the table below for available built in options.



Note: creating emulators of big size can go out of your monitor’s range. Make sure that emulator fits your window screen.

9.       Hardware lets you modify default hardware properties of your emulator. When you choose target sdk it’ll be filled with the default values for that platform. New option at the corner lets you add some more properties based on your requirement and availability.



10.   Click on Create AVD to create emulator.

Eclipse takes some time to create emulator and when done, newly created emulator will be listed in AVD Manger. Select your emulator and click Start to run emulator. When clicked on start, launch options pop-up appears, you can configure your launch options using this pop-up, just ignore it and click on launch for now to run emulator.

Emulator booting


Emulator after booting - in portrait mode

To change emulator’s orientation,

a.       Turn on numlock.

b.      Press and hold numlock and press number 7 from num keys.


Emulator – landscape mode



No comments:

Post a Comment