So! Finally, the wait is over. We are ready to make our first android app. But, keep in mind that the motto of this app is not to go deep into the programming concepts, but to familiarize ourselves with the Eclipse IDE and Android SDK, touching the most trivial but fundamental concepts in android app development.
Since most of the programming tutorial start with making a “Hello World” app, I will also try to do the same. But since there can be various version of a “Hello World” app in Android (HOW? We’ll see!), I will start with the simplest in this tutorial and will be build upon it in the later post, finally leading to the development of the really tough one. Without wasting more time, let’s get straight to the point!
Familiarizing with Eclipse
Let’s start the Eclipse and focus on its various components. While starting, it may ask for a work space. Just let it be the default one but remember it, as all of your projects will stored at this address.
If you are opening it for the first time, you may see the Welcome screen. You can take sometime to explore. But, you can close it for following the tutorial. After doing so, you will see a screen split into various parts.
OK! Now, let’s analyze each of the components.
The left most component (called Package Explorer) shows all the projects that exist in your work space (described above).
The bottom right panel has further tabs, of which the Console shows the execution of the program. We will be discussing about the other tabs as we go along.
The middle section is simply an editor which allows us to write our code
Now, lets look at the toolbar. If you have successfully configured the development environment, you will find two additional icons (one as a link to Android SDK manager and other to AVD manager). Have a look!
AVD Manager stand for Android Virtual Device Manager. It is used to make emulators. Heard of this word?
For those who didn’t, emulator is used to provide a virtual Android-like environment to the developer in order to allow the development of the apps by the people who don’t have an Android phone. Since there are multiple versions of Android avaliable, there are multiple versions of emulator too. This AVD manager allows us to make the emulator of the desired version with the desired requirements. We will be looking on the process when we will come to the debugging and execution of the app (Debugging?? Just wait for sometime!!).
Each android app is the result of a project. You can consider the app as the output when you are able to successfully compile the app, just like .out is the output when you compile a C program with GCC (though the app may not function as desired because compilation doesn’t ensure proper execution). As a result, most of the beginners tend to end up seeing “Application stopped unexpectedly” error in spite of the entire process being error-free.
So, if you also end up doing so, don’t get disheartened! It’s a necessary step in learning.
OK. moving on, let’s create the project.
- Go to File->New->Android Project.
- Choose a Name. I will choose Hello World.
- Select a platform. For me, it’s 2.2.
- In the package name, choose something that has the form com.*.*. I am choosing com.hello.world.
- Leave the other things as it is. Click Next and Finish.