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

  • 23 May

    Escape Apostrophe in JavaScript

    Table of ContentsWays to escape Apostrophe in JavaScriptUsing escape characterUsing alternate String syntaxUsing template literals In this article, we will see how to escape Apostrophe in JavaScript. Let’s see what happens if we have singe quote in String and we also use single quotes to declare the string in JavaScript. [crayon-628c0cf144914548927105/] Output: unknown: Unexpected token […]

  • 23 May

    Escape Ampersand in URL in JavaScript

    In this post, we will see how to escape ampersand in JavaScript. To escape Ampersand in JavaScript, use encodeURIComponent() in JavaScript. [crayon-628c0cf144bd3204196040/] Output [crayon-628c0cf144bda142587388/] As you can see that when we called encodeURIComponent, it encoded & to %26. You can use % to escape characters that aren’t allowed in URLs. Here & is 26 in […]

  • 23 May

    TypeError: foreach is not a function in JavaScript

    Table of ContentsUse Object.keys() or Object.values() or Object.entries()Use Arrays.from() TypeError: .foreach is not a function occurs when we call foreach() function on object which is not array, Set or Map. To resolve this issue, you can use Object.keys() rather than directly calling foreach() on object or use Array.from() to convert array like object to array. […]

  • 23 May

    TypeError: toUpperCase is not a function in JavaScript

    TypeError: .toUpperCase is not a function occurs when we call toUpperCase() function on object which is not an string. toUpperCase() function can be only called on string. To resolve this issue, convert value to string using toString() ,method before calling toUpperCase() method. Let’s see with help of simple example [crayon-628c0cf1452b8060191359/] You will get following error […]

  • 23 May

    TypeError: split is not a function in JavaScript

    TypeError: .split is not a function occurs when we call split() function on object which is not an string. split() function can be only called on string. To resolve this issue, convert value to string using toString() ,method before calling split(). Let’s see with help of simple example. [crayon-628c0cf145604583898968/] Output [crayon-628c0cf14560c323100027/] We got this error […]

  • 22 May

    TypeError: replace is not a function in JavaScript

    TypeError: .replace is not a function occurs when we call replace() function on object which is not an string. replace() function can be only called on string. To resolve this issue, convert value to string using toString() ,method before calling replace() method. Let’s see with help of simple example where we want to remove . […]

Comments

Leave a Reply

Your email address will not be published.

Subscribe to our newletter

Get quality tutorials to your inbox. Subscribe now.