Create Things and Build Stuff

Android is now one of the most popular smartphone/mobile operating system in the world. This tutorial will help you on creating your first android application (Hello World application) using Eclipse IDE and Android Development Tools (ADT) and also Android Virtual Device (AVD) or your real android device to run the application.

Tools used in this tutorial:
1. JDK 1.6
2. Eclipse IDE
3. Android SDK

Note
I suggest you to use ADT Bundle so installing ADT plugin in Eclipse is not required. You can download it here ADT Bundle

1. Create Android Project

2. Configure Project Settings

Enter your Application Name, Project Name and Package Name. Select Minimum Required SDK, the lowest version of Android that the application supports. Target SDK, the highest version of Android. Compile With, android version which the application will be compiled with. And Theme. If you are not sure, just leave it as it is. Click Next.

Click Next again

3. Configure Launcher Icon

Create you launcher icon as you want or as you requirements need. In this tutorial i have changed few default settings.

4. Create Activity

Choose an activity BlankActivty template and click Next. An activity is a single, focused thing that the user can do. Almost all activities interact with the user, so the Activity class takes care of creating a window for you in which you can place your UI.

Enter Activity Name and click Finish

5. Project Structure

Here is the project structure generated by the IDE

the layout file (activity_hello.xml) is shown in the Graphical Layout mode as follow

6. Code

Open string.xml and there is string property with name hello_world which contains value as ‘Hello world!’ that is used by TextView to be shown in our application.

file : string.xml

1

2

3

4

5

6

7

<resources>

<string name="app_name">HelloWorld</string>

<string name="action_settings">Settings</string>

<string name="hello_world">Hello world!</string>

</resources>

Open activity_hello.xml and you should see the element. Take a look at “android:text=”@string/hello_world”. The “@string/hello_world” refers to “Hello world!” in string.xml