Saturday, May 21, 2011

Android emulator

Few people enquired me about how to test their Android app. Of course most of you have an android phone to test whether its working or not. But that is not the case with few countries, say India, (believe it or not) where Symbian still leads the Smartphone game. Why should I hide it from you? The phone I bought two months ago is Nokia C7, which is a Symbian^3 phone. So this post is to those readers who dont have an Android phone.

We can use an Emulator. An emulator runs your application as a virtual layer on other host so that you don’t have to spare an Android phone to test your apps. It runs the same base code as an actual device.

A true emulator based on QEMU is installed along with your Android SDK. It acts like a hosted virtual machine monitor. We’ll now create an Android Virtual Device to use this emulator, (from here onwards I will use the term AVD).

Open Android SDK and AVD Manager from the Eclipse Window menu. Clicking on New opens a “Create new AVD window”. Specify any parameters for your new AVD,
Name: Any name you choose
Target: Version of Android you want to install on this AVD. If you dont have targets, download them from the “Available Packages” window of Android SDK. You can also specify some hardware properties in this dialog box.

Once done, you’ll notice a new virtual device created on your AVD and SDK Manager. You can now start this AVD from “Start” option in the manager. This will open the emulator in a pop-up.
You can interact with the device just like you would with a physical device. You may use the mouse to give touch inputs and type on keyboard keys to trigger the simulated device keys.

I hope this will solve the problem of Android developers with other no device for testing. If this blog found useful for you, please "Follow". If you have any questions, you may post as comment below.

No comments: