Home » Android Studio Programs » Android Button » Android Studio: Sum two numbers

Android Studio: Sum two numbers

If you want to make a program for the sum two numbers in android. The code will be following.

In this app we need

  • 2 EditText controls to take input of 2 numbers from the user,
  • 1 Button for getting result after putting the numbers in the EditText controls,
  • 2 TextView, 1 for setup the heading of the program and 2nd for showing the result.

we will also use of Tost for showing the result.

This android app will cover working of,





  1. activity_main.xml

2. MainActivity.java

Our App will look like this.

If you are looking for List View you can go here – Android List View

One Responseso far.


    I have done the same as you mentioned but I couldn’t open it on my virtual device as there is showing some null pointer exception. plz help me to resolve this problem

Leave a Reply

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