Android Hello World Example

hello world android

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

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

Select File–>New–>Other–>Android Application Project and click Next Button
android hello world

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

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

file : activity_hello.xml

And here’s our activity

file :

We don’t need to change any code yet.

7. Run Configuration

Right click on the project and select Run As–>Run Configurations. If there is no AVD already created, create it by click Manager

Click New

Configure AVD as you wish or follow like below

8. Run Application

Right click on the project and select Run As–>Android Application

9. Running Program

Eclipse will running AVD and our application should be there.

Click on Hello World icon, and here’s what our application looks like, very basic application

Facebook Comments

Agung Setiawan

Agung Setiawan adalah software engineer di, penulis sekaligus pecinta sastra, dan pembaca buku

Halo, perkenalkan saya Agung Setiawan.
Seorang Software Engineer di BukaLapak, penulis buku, blogger, gunpla builder, tech educator.
Simak pemikiran saya soal dunia Software Engineering via Twitter di @agungsetiawanmu dan facebook
Mau belajar Vim bareng saya?
Belajar ngoding dari nol menggunakan PHP

3 thoughts on “Android Hello World Example

    1. 😀
      iya ntar nyusul tutorial yang lain hehe sama strings.xml itu bawaan hasil generate Eclipse pas pertama bikin project bisa ditemukan di src/nama_paket/MainActivity.Java (pada contoh diatas nama_paket-nya com.agung.helloworld
      Sedangkan strings.xml bisa dilihat di res/values/strings.xml

Leave a Reply

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