How To Add two Numbers in Android!

Step# 01

First Create new application go to File->New->Android Application Project

Enter Application name, project name and package name.

How To Add two Numbers in Android!

 

 

 

 

 

 

 

 

 

 

 

 

 

Step#02

And then click next until you get this screen

How To Add two Numbers in Android!

 

 

 

 

 

 

 

 

 

 

 

 

 

Step# 03

Now select empty activity and then click next.

How To Add two Numbers in Android!

 

 

 

 

 

 

 

 

 

 

 

 

 

Step# 04

After click on next button then give the name of your activity and then click on finish.

How To Add two Numbers in Android!

 

 

 

 

 

 

 

 

 

 

 

 

 

Step# 05

This is the project layout of adding two numbers.

How To Add two Numbers in Android!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step# 06

Now open activity_two_numbers.xml and start design GUI of your AddingTwoNumber application this is the xml tag of your application and ignore all warnings.

“http://schemas.android.com/apk/res/android”

android:layout_width=“fill_parent”

android:layout_height=“fill_parent”

android:orientation=“vertical” >

“@+id/textView1″

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_gravity=“center”

android:textSize=“20dp”

android:text=“Number 1″

/>

“@+id/field1″

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_gravity=“center”

android:hint=“Enter num1″ >

“@+id/textView2″

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:textSize=“20dp”

android:layout_gravity=“center”

android:text=“Num 2″

/>

“@+id/field2″

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_gravity=“center”

android:hint=“Enter num2″ >