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. MainActivity.java, activity_main.xml and AndroidManifest.xml file.

activity.main.xml

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.

MainActivity.java

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

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.

AndroidManifest.xml

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

strings.xml

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.

Output

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

First Android App development exmple
Output

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

Team RCV Academy

About Team RCV Academy

RCV Academy Team is a group of professionals working in various industries and contributing to tutorials on the website and other channels.

View all posts by Team RCV Academy