First Android App – Create your first Android Application

Hello World! – First Android App

This tutorial will guide you in creating a very simple first Android app.

It is very easy to build the Application in Android. We had learned in our old tutorials about the basic concepts.

So it’s time to do some coding and create the Hello World Example in Android.

Requirements for creating first android app

Here, we use the Eclipse IDE. Update the SDK tools in SDK manager if not with the latest Android version.

Example with code:

Create an Application by following the steps:

Click on File->New->Android Application Project->HelloWorldExample.

See the figure below for creating a new application:

First Android App development setup
First Android App development Setup

 Provide some name of the application, the package name is created by default. If you want you can change the package name.

After providing the details in above screen, press Next and create an Activity as shown in the figure below:

First Android App Development Step by Step
First Android App Development

Here, you can choose anyone. However, for a single Activity, it will choose the first option by default i.e. BlankActivity. Press Next and then you will see the step shown in the figure below:

Android App Development setup
First Android App Development

It shows the name of our Activity, i.e MainActivity, and its layout file. We can change the name of both if want.

Now, after pressing Next it creates the application in your workspace. This can take few minutes (especially if this is the first project you created).

Let’s see and understand some of these files, i.e., activity_main.xml and AndroidManifest.xml file.


<RelativeLayout xmlns:android=""
tools:context="com.example.helloworldexample.MainActivity" >

android:text="@string/hello_world" />


This XML file is our Main layout file which shows the view on the screen. Here, it contains a TextView with some text inside the RelativeLayout element.

This is our MainActivity which sets the view inside onCreate() method.

public class MainActivity extends ActionBarActivity {

protected void onCreate(Bundle savedInstanceState) {

Here, we can see very well it takes the reference of our layout. We can add various widgets to show on the screen, just take the reference of all of them in our Activity.

By default, this application set the intent-filter for our MainActivity in AndroidManifest.xml file.


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
android:versionName="1.0" >

android:targetSdkVersion="21" />

android:theme="@style/AppTheme" >
android:label="@string/app_name" >
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />


Here, you can see the version name, code, app name etc. and our MainActivity is registered by default with action and the category tag.


<string name="app_name">HelloWorldExample</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>

This is our strings file in values folder. Here, we can create the strings and fetch in our whole application.

This is your auto-generated app and now you can compile and run the app from IDE.


Following is the output of our application. You can see it shows a text “Hello World” on screen.

First Android App development exmple

So, this is all about the simple auto-generated application of Android. In future posts, we will learn more about custom apps.