Writing Your First Android Application: A Hello World Example – Part 1 – Create an App

Now that all the necessary tools are installed (see What Do You Need to Start Developing an Android App?), we can get to the fun part – coding. Grab yourself a keyboard, a monitor you can stare in and a beer in your hand, and read on.
Fire up Eclipse and either choose the default workspace or point it somewhere else.
Go File > New > Android Project and create a new project:

Select the version of Android OS – I chose 3.1 for this article. On the next screen, type in a package name – normally that will be your domain name in reverse order with your application name after that. For this example, the package name will be com.luefher.GreetMe:

Hit finish and you got yourself a working Android app that does nothing. Go ahead and hit F11 key (Debug) to verify that everything needed is installed and runs. The IDE may ask you what you want to use to run the package – the obvious choice is Android. One thing to note here is that, while very annoying, you are going to have to get into a habit of first selecting your package in Package Explorer and then hitting that F11 button (debug). Otherwise, the IDE will try to run the currently selected file, will fail and create an .out file on top of that.

Now your Eclipse should look something like this:

Congratulations! You got a working app!
Now let’s look at the Android package file structure in the Package Explorer in Eclipse.

This entry was posted in Android and tagged , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *