Android Hello world example using Android Studio

In previous post, we have setup android studio and SDK. In this post, we will create Android hello world app.
Once you are done with Android studio download and installation, you will see below screen.

Start new Android project

Click on “Start a new Android studio project”. You will see below screen.

Create New Android Project

Application Name : You need to provide name of application.
Company Domain : If you have your domain, you can put it here.
Package name : Package name should be unique. When you publish your application with google play store, google play store distinguishes your app by package name only.

Click on Next after filling above form.

Choose Phone and tablet

Choose “Phone and Tablet” and select Minimum SDK, you want to support for your application.
Click on Next and you will see below screen:

Choose Android Activity

It is activity selection screen. We will choose “Empty Activity”. It should be good enough for our hello world project.
Click on Next.

Customize Activity

Activity Name : It is name of Activity , you want to create. I have put it as “HelloWorldActivity”.
Layout Name : When Android studio create activity for you, it also create layout xml file which binds with the activity.
Don’t worry , if you do not understand about it much, I will write separate post to explain Activity.
Click on Finish. You will get below screen.

Created Android Hello world

Run Hello World App :

Lets run the app now.
Go to Run – > Run ‘app’ , you will see below screen.

Select AVD screen

We are going to create Android Virtual Device to demonstrate create android app.
Click on “Create New Virtual Device” , you will see below screen.

Choose Android Hardware

Choose suitable android configuration on which you are going to test your application. Click on next.

Download System Image

Here we are going to select System image, you may not have downloaded system image, so you can download by clicking on link.
When you click on download, you will see below screen.

Download Android Virtual Device

It will download system image, once done click on Finish. You will see below screen.

Android Virtual Device

You can provide name to your AVD. Click on Finish.

Nexus 5 API 25

Choose downloaded AVD and click on Ok.
You will see an additional app started.

Android Hello World Screen

Bingo!! we have successfully create Hello world Android App. Don’t worry if you do not understand much yet, I will explain about Activity and Android folder structure which will help you to understand created android app.

Related Posts

  • 22 January

    FizzBuzz program in Python

    In this post, we will see how to program FizzBuzz in Python. As per wikipedia, Fizz buzz is a group word game for children to teach them about division. Here are the rules of the game: First player starts the game by saying number 1. Next player says next number but fun part is If […]

  • Format double to 2 decimal places in java
    22 January

    7 ways to format double to 2 decimal places in java

    Learn about how to format double to 2 decimal places in java

  • Escape double quotes in String in Java
    19 January

    How to escape double quotes in String in java

    In this post, we will see how to escape double quotes in String in java. There are scenarios where you need to escape double quotes already present in the String. This generally happens while dealing with JSON file format or reading file data. Escape double quotes in java Double quotes characters can be escaped with […]

  • Convert Date to LocalDate in java
    12 January

    Java Date to LocalDate

    In this post, we will see how to convert Date to LocalDate in java. Sometimes, we may need to convert Date to new Java 8 APIs and vice versa. There are multiple ways to convert Date to LocalDate in java. Read also: Convert LocalDate to Date in java Using toInstant() method of Date class You […]

  • Convert LocalDate to Date in java
    11 January

    Java LocalDate to Date

    In this post, we will see how to convert LocalDate to Date. Java 8 has introduced a lot of new APIs for Date and time. There can be many ways to convert Java LocalDateTime to date. Using Instant object You can convert LocalDate to Date using Instant object which we can from Zone. Here is […]

  • 04 January

    How to change java version in intellij

    Learn about how to change java version in intellij.

Comments

Leave a Reply

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

Subscribe to our newletter

Get quality tutorials to your inbox. Subscribe now.