In this tutorial you will learn about the Android Hello World Application and its application with practical example.
Android Hello World Application
Here you will learn how to create an android project using Android Studio. Lets start our first Android Project ,Before Creation Android Project you have to make sure that you are done with complete setup of Android Studio.
Create An Android Application
First step for creation an App is Simply click on Android Studio Icon. Below Screen Will Appear, Click on Start a new Android Studio Project
On Next Screen you need to configure your project , Here you need to fill some details like Write Application name ,Company Domain, Project Location. Please check below screen.
Click on next and Select the form factors of your app Like Minimum SDK and for which device you want to create this Application.
Next step is Selection of an Activity for Device
Next Level for creation Android App is Customize the Activity like below Image:
And finally click on finish for ends up with Basic Steps. You are done with project creation , now its time to do work on it. In below Image Activity is appeared ,An Activity is a class for Android App. this is a main entry point for an App.
On Second Screen you will get Xml file from which you can create UI for Android App.
You can modify this file according to requirements for change the Layout of your App.
For “Hello World” Application the Layout xml will have following content
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.example.myapplication.MainActivity"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" /> </RelativeLayout> |
Here Relative Layout is a view group which display child view in relative position and TextView display text to the user and it also allow them to edit programmatically.
Now lets run this project on AVD (Android Virtual Device),I hope you have created AVD at the time of installation. If not no need to worry,You can create your AVD by using some easy steps:
Click on tools ->Android->AVD Manager. Android Virtual Device Manager Popup will appear click on Create Virtual Device.
Select Hardware and click on Next.
Click on Finish and your AVD is ready to Use. Now Run your project on your Android Virtual Device.
Congratulations! You have developed your first Android Application. Just follow All above steps for creation of your new poject.