Welcome to our Second Tutorial for Android Application Development. Today you will be Building Your First App – a simple “Hello World” Application. But first we will learn how to set up an Android Emulator, Use Dalvik Debug Monitor Service (DDMS) to get list of connected devices, and finally we’ll run our Application on the Connected device. I have already explained how to Set up the Development environment for Android in our last tutorial. For those who have not yet Set up their Development Environment, are recommended to go through it.
Well, let’s get Started with our today’s tutorial.
What is an Android Emulator ?
The Android SDK provides a Virtual Mobile Device Emulator that you can prototype, test, and develop Android applications without the need for a physical device. But before launching the emulator, you must create an Android Virtual Device (AVD) which defines the system image and device settings used by the emulator.
Setting Up the Android Emulator
Here are the steps to Set up the Android Emulator :
- In Eclipse, select Window > AVD Manager.
- Click New
Create new AVD dialog box appears
- Type the name of the AVD, say Mydevice.
- Choose a target (Platform you want to run on the emulator. It can be either Android API or Google API.)
- [Optional] Enter the SD card size, say 400.
- [Optional] Snapshot : Enable this to make start up of emulator faster.
- [Optional] Select required Skin.
- [Optional] You can add specific hardware features of the emulated device by clicking the New…button and selecting the feature.
- Click OK.
- To launch the Android Emulator, open AVD Manager > Select Device > Start.
Launch options dialog box appears
Click on Launch to launch the Android Emulator.
The DDMS Perspective in Eclipse lets you access all of the features of DDMS from within the Eclipse IDE.
To access the DDMS perspective, go to Window > Open Perspective > DDMS. If DDMS does not appear, go to Window > Open Perspective > Other … and select DDMS from the Open Perspective window that appears.
DDMS perspective shows you the list of Connected devices to your PC on which you can run your application.
Now we are all Set to start Building our First Application…
Creating a New Android Project
- Open File > New > Android Application Project
Name Convention for Package Name :
company.developer.ProjectName or developer.ProjectName
- Click on Next
- Click Next
Configure Launcher Icon
- Click Next
- Click Next
- After Clicking on Finish, Eclipse looks similar to this :
Running The Application
To run your Application :
- Right click on FirstApp > Run as > Android Application .
- Select your Device on which you want to run your Application.
Here is the Screenshot of our First Application running successfully .
So, that’s it for our today’s tutorial. In our next Tutorial, we will design a Simple Toast Application, and learn about Packages and Layouts in Android.Our next tutorial will be coming out in a few days, keep practicing till then. 😉
NOTE : Our upcoming tutorials might require Rooted Smartphones to run some Applications. For those who want to, can Root your Device with just one click using iRoot.