This tutorial shows how to create a simple Android hello-world project in Eclipse, and run the hello-world project on Android Virtual Device (AVD).
Summary steps to develop an Android application :
- Download and install Android SDK ADT Bundle for Windows
- Create Android Project by Using Eclipse Wizard
- Create an Android Virtual Device (AVD)
- View Result
This Android Hello-World project is developed under Windows 7, and JDK 1.6 has been installed previously.
1. Download and Install Android SDK ADT Bundle for Windows
Download Android SDK first: http://developer.android.com/sdk/index.html. This is the only tool you need to download to complete the following Hello-World example.
Unzip the downloaded file. (You can extract it to anywhere, but normally it should be under your program file directory.) There is an "eclipse" directory which already have Android development environment integrated. Go to the direction, and start eclipse by double clicking "eclipse".
2. Create Android Project by Using Eclipse Wizard
Create a new "Android Application Project" by following the wizard. The steps look like the following:
The project directory is like the following:
Now the project is successfully created, the next step is to create a virtual smartphone for the Hello-World to run.
3. Create Android Virtual Device
If you run the created hello-world project at this moment, the project will not run. Because there is no device set up yet. To run an Android project, you will need to create an Android Virtual Device (AVD), so that the created project can run on a virtual smartphone under emulator. You can also directly go to "Android Virtual Device Manager" by clicking the icon on the toolbar like the following:
If you don't set up an AVD first and run th project, the The following windows will be popped up to ask you to create an AVD. You can follow the following steps. Since I have an Nexux 4, I will add Nexus 4 as my AVD to run the project.
4. View Result
In this post, you have seen a very simple Android Hello-World application. As shown above, Android project can be quickly developed by using eclipse with ADT integrated. The next step is understanding the content of the code.
<pre><code> String foo = "bar"; </code></pre>