Tuesday, 13 June 2017

Simple Calculator app in Android

Simple Calculator app in Android

Download Source Code

This post is similar to that of 

Adding two numbers in Android

 We are using different operations like subtraction, multiplication,division and also addition.

Read Working with Multiple Buttons

This example is the combination of the last two post

Adding two numbers in Android and Working with Multiple buttons,so if you have practiced that well this program is easy for you or else practice that both examples and continue this example.

We need to make the design plan.

Create a new project and Just drag and drop and edit as per in the design.


The number 1 and Number 2 can be typed using the help of hint property.

To use the hint right click on the Plain Text  and EditHint


Then register the buttons,edittext's, textview's in MainActivity.java


After that add switch case statement  as in the last post and include the addition of two numbers example code and also include code for other operations also as in the image.


I think it is very easy to understand right! yeah it's so simple to develop android apps than you think if you have basic programming concepts and interest to learn!!!

Let we see the Output



When clicked ADD Button

When Clicked SUB Button

When clicked MUL button

When clicked DIV Button


How to use Android Phone as an Emulator

Practice this example more times and do it without referring any example codes.

It will make you to have strong knowledge in working with buttons.

1 comment :

  1. I like to recommend exclusively fine plus efficient information and facts, hence notice it: 172 cm in feet