You are on page 1of 26

MAHARASHTRA STATE BOARD OF TECHNICAL

EDUCATION

Loknete Gopinathji Munde Institute of


Engineering Education & Research

NASHIK- 422 002

MICRO PROJECT REPORT

Academic year: 2021-22

Topic: Calculator
Course:CO6I
Course Code: 22617
1
CERTIFICATE
This is to certify that,

Prem Nitin Hude Roll No 31 of the Sixth Semester of Diploma in


Computer Engineering of an Institute, Loknete Gopinathji MundeInstitute
of Engineering Education & Research (Code: 1477) has completed the
Micro Project satisfactorily in Subject Mobile Application Development
(22617) for the Academic Year 2021-2022 asprescribed in the curriculum.

Place: Nashik Date: / /2022

Enrollment no: 1914770086 Exam Seat No.:-

Subject Teacher Head of Department Principal

2
WEEKLY PROGRESS REPORT
MICRO PROJECT

SR.NO. WEEK ACTIVITY PERFORMED DATE


SIGN OF GUIDE

Discussion and finalization


1 of topic
1st

Preparation and
2 submission of Abstract
2nd
3 Literature Review
3rd
th
4 4th and 5 Collection of Data

5 6th and7th Collection of Data

th Discussion and outline of


6 8th and 9 Content
7 10th Formulation of Content

th Editing and proof Reading


8 11th and 12
of Content

Compilation of Report &


9 13th
Presentation
10 14th Seminar

11 15th Viva voce

Final submission of
12 16th Micro Project

Sign of the student Sign of the faculty

3
ANEEXURE II
Evaluation Sheet for the Micro Project
Academic Year :2021-2022 Name of the Faculty: Prof. J.S.Chandwade.
Sub: MAD Course Code: CO6I
Semester: VI
Title of the project:
Cos addressed by Micro Project:
A. Interprete feature of Android operating system.
B. Develop rich user Interfaces by using layouts and controls.
C. Use User interface components for android application development.
D. Configure Android environment and development tools.
Major learning outcomes achieved by students by doing the project
(a) Practical outcome:
1. Install & configure Android Studio.
2. Configure android development tools(ADT).
3. Android program to implement layouts.
4. Programs to Async task using SQLite.
(b) Unit outcomes in Cognitive domain:
1. Write / assure / made the Document.
(c) Outcomes in Affective domain:
1. Follows safety practices.
2. Follow Ethics.
3. Practice Good Housekeeping. 4.
Comments/suggestions about team work /leadership/inter-personal
communication (if any)
……………….…………………………………...…………………………...............................

Marks out of (4) for Total out of


Marks out of (6)
Roll performance
for performance (10)
No Student Name in oral/
in group activity
presentation
(D5 Col.8) (D5 Col.9)

(Signature of Faculty)
4
INDEX
Sr No. Content Page No.

1 ACKNOWLEDGEMENT 6

2 INTRODUCTION 7

3 ABOUT PROJECT 8

4 PROCEDURE 9

5 ADVANTAGES AND DISADVANTAGES 10

6 CODE 11

7 OUTPUT 23

8 CONCLUSION 25

9 REFERENCE 26

5
ACKNOWLEDGEMENT

 I am very thanking full Loknete Gopinathji Munde


Institute of Engineering Education & Research who has given
me opportunity to have project knowledge of Professional
practices.
 I am also thankful to the means for providing me the
informationof Professional Practices which is the base of the
Project.
 Lastly I am thankful to my subject teacher for proper
guidance and cooperative in preparation of the project work.

6
INTRODUCTION
Android is a mobile operating system based on a modified
version of the Linux kernel and other open source software, designed
primarily for touchscreen mobile devices such as smartphones and
tablets. Android is developed by a consortium of developers known as
the Open Handset Alliance and commercially sponsored by Google. It
was unveiled in November 2007, with the first commercial Android
device, the HTC Dream, being launched in September 2008.
Android Studio is the official[7] integrated development
environment (IDE) for Google's Android operating system, built on
JetBrains' IntelliJ IDEA software and designed specifically for Android
development.[8] It is available for download on Windows, macOS and
Linux based operating systems or as a subscription-based service in
2020.[9][10] It is a replacement for the Eclipse Android Development
Tools (E-ADT) as the primary IDE for native Android application
development.
Android Studio was announced on May 16, 2013, at the Google
I/O conference. It was in early access preview stage starting from version
0.1 in May 2013, then entered beta stage starting from version 0.8 which
was released in June 2014.[11] The first stable build was released in
December 2014, starting from version 1.0.[12]
Gradle is a build automation tool for multi-language software
development. It controls the development process in the tasks of
compilation and packaging to testing, deployment, and publishing.
Supported languages include Java (as well as Kotlin, Groovy, Scala),
C/C++, and JavaScript.[2] It also collects statistical data about the usage
of software libraries around the globe.

7
ABOUT PROJECT

This whole project has only one concept, that to do calculations. You can
perform calculations as in the simple calculator. This whole project is designed
using Android Studio. The project uses Java programming language for field
validations. Gradle’s and wrappers are used for assigning the SDK’s and other
runtimes platforms. This project also can be implemented in different gadgets
like mobile phones. The whole project has a simple-looking UI design.

How To run the project?

In order to run the project, first, install Android Studio. Then import the project
from the studio’s homepage. Your project setup will automatically start. All the
Gradle build files will automatically install inside your project root directory.
Run the project and set up your virtual device and run the emulator. The project
will start and there you can add your task and to-do lists.

To develop this simple calculator app the requirements and prerequisites are as
follows:

1. Java: First of all you need to have the knowledge of Java Programming. Java
programming plays a very important role as we will develop the app code in
Java

2. XML: XML is another important part of our android application. It will be


used for the development of the user interface for the application

3. Android Studio: Android Studio is the backbone of our application, as we


will develop our app using android studio. Android virtual device is also
shipped with android studio that will be helpful in testing whether the
applications are working or not

8
PROCEDURE

1. First of all, we would need to write the code

2. Now, we’ll see what’s there in the code to understand it better. So to create
the interface we’ve added the number button and the operators for the
calculator. This will be for the users to interact with our calculator. We’ve
arranged them horizontally in four layers. This will be present in the
main_activity.xml file.

3. Also, there are the following things that we have added in the drawable that
are as follows:

1. The description of the buttons that we use. You can find that code in Res
> drawable > Buttons.xml

2. We have added the description of the operator buttons. You can find that
code in Res > drawable > Operator.xml

3. We also described the selector in drawable, it will show the effect as soon
as we select the buttons. You can find that code in Res > drawable >
Selector.xml

4. And then finally we had written the code for the actual processing of the
calculator. For this, the code is written in the MainActivity.java file.

5. So, once we are ready with code we will run the calculator.

9
Advantages and Disadvantages

Advantages of Age Calculator

This technology allows students solve complicated problems quickly and in an


efficient manner. Additionally, it can reduce the problem to simpler tasks and
allows the student to devote more time in understanding the problem. Secondly,
they are saved from monotonous calculations and the same boring mundane
procedure.
The above advantages help students to avoid boredom, and it does not demoralize
their mathematical understanding. If mathematics is not made entertaining, pupils
can feel bored, and it can demoralize their mathematical understanding.

Disadvantages of Age Calculator

Even though calculators can do the basic operations instantly, students should not
use it all the time. When a student is always dependent on a calculator for solving
problems of addition, subtraction, multiplication and division, it may make them
incapable of solving these basic operations manually. This may cause them real
trouble during their tests and even at the later stages of their life where they will
need these skills to solve complex problems.

The availability of graphic calculators has made it easier for students to cheat
during their tests. Besides letting you perform basic mathematical operations,
these calculators allow you to store information like notes, formulas etc. This gives
students an opportunity to store unauthorized information to cheat on the test. This
is one of the major disadvantages of a calculator.

10
CODE
XML FILE

<?xml version="1.0" encoding="utf-8"?>


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">

<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_marginBottom="1pt"
android:layout_height="wrap_content"
android:ems="10"
android:layout_weight="1"
android:background="@color/black"
android:gravity="right|center"
android:textColor="@color/white"
android:textSize="20pt"
android:inputType="textPersonName"
android:text="0" />

<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>

<TableRow
11
android:layout_marginBottom="1pt"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/btnSeven"
android:text="@string/_7"
android:onClick="numberEvent"
android:layout_marginRight="1pt"
android:layout_height="30pt"
android:layout_weight="1"
android:textColor="@color/white"
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
<Button
android:id="@+id/btnEight"
android:text="@string/_8"
android:layout_marginRight="1pt"
android:onClick="numberEvent"
android:layout_height="30pt"
android:layout_weight="1"
android:textColor="@color/white"
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
<Button
android:id="@+id/btnNine"
android:text="@string/_9"
android:layout_marginRight="1pt"
android:onClick="numberEvent"
android:layout_height="30pt"
android:layout_weight="1"
12
android:textColor="@color/white"
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
<Button
android:id="@+id/btnDivide"
android:text="@string/div"
android:onClick="operatorEvent"
android:layout_marginRight="1pt"
android:layout_height="30pt"
android:textColor="@color/white"
android:layout_weight="1"
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
</TableRow>
</TableLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TableRow
android:layout_marginBottom="1pt"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/btnFour"
android:text="@string/_4"
android:layout_marginRight="1pt"
android:onClick="numberEvent"
android:textColor="@color/white"
android:layout_height="30pt"
android:layout_weight="1"
13
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
<Button
android:id="@+id/btnFive"
android:text="@string/_5"
android:layout_marginRight="1pt"
android:layout_height="30pt"
android:textColor="@color/white"
android:onClick="numberEvent"
android:layout_weight="1"
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
<Button
android:id="@+id/btnSix"
android:text="@string/_6"
android:layout_marginRight="1pt"
android:onClick="numberEvent"
android:layout_height="30pt"
android:textColor="@color/white"
android:layout_weight="1"
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
<Button
android:id="@+id/btnMultiply"
android:text="@string/multiply"
android:onClick="operatorEvent"
android:layout_marginRight="1pt"
android:layout_height="30pt"
android:textColor="@color/white"
android:layout_weight="1"
14
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
</TableRow>

</TableLayout>

<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TableRow
android:layout_width="match_parent"
android:layout_marginBottom="1pt"
android:layout_height="match_parent">
<Button
android:id="@+id/btnOne"
android:text="@string/one"
android:layout_marginRight="1pt"
android:layout_height="30pt"
android:layout_weight="1"
android:textColor="@color/white"
android:onClick="numberEvent"
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
<Button
android:id="@+id/btnTwo"
android:text="@string/two"
android:layout_marginRight="1pt"
android:layout_height="30pt"
android:textColor="@color/white"
android:layout_weight="1"
15
android:onClick="numberEvent"
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
<Button
android:id="@+id/btnThree"
android:text="@string/three"
android:layout_marginRight="1pt"
android:layout_height="30pt"
android:layout_weight="1"
android:layout_width="30pt"
android:textColor="@color/white"
android:onClick="numberEvent"
android:background="@color/purple_200"
></Button>
<Button
android:id="@+id/btnMinus"
android:text="@string/minus"
android:layout_marginRight="1pt"
android:layout_height="30pt"
android:onClick="operatorEvent"
android:textColor="@color/white"
android:layout_weight="1"
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
</TableRow>
</TableLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TableRow
16
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="1pt">
<Button
android:id="@+id/btnAC"
android:text="@string/percent"
android:layout_marginRight="1pt"
android:onClick="percentEvent"
android:layout_height="30pt"
android:layout_weight="1"
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
<Button
android:id="@+id/btnZero"
android:text="@string/zero"
android:layout_marginRight="1pt"
android:layout_height="30pt"
android:layout_weight="1"
android:textColor="@color/white"
android:layout_width="30pt"
android:onClick="numberEvent"
android:background="@color/purple_200"
></Button>
<Button
android:id="@+id/btnDot"
android:text="."
android:layout_marginRight="1pt"
android:layout_height="30pt"
android:onClick="numberEvent"
android:layout_weight="1"
android:textColor="@color/white"
android:layout_width="30pt"
17
android:background="@color/purple_200"
></Button>
<Button
android:id="@+id/btnPlus"
android:text="@string/plus"
android:layout_marginRight="1pt"
android:layout_height="30pt"
android:layout_weight="1"
android:textColor="@color/white"
android:onClick="operatorEvent"
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
</TableRow>

</TableLayout>

<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>

<TableRow
android:layout_width="match_parent"
android:layout_marginBottom="1pt"
android:layout_height="match_parent">
<Button
android:id="@+id/btnC"
android:text="@string/cancel"
android:layout_marginRight="1pt"
android:layout_height="30pt"
android:layout_weight="1"
android:layout_width="30pt"
18
android:onClick="clearEvent"
android:background="@color/purple_200"
></Button>
<Button
android:id="@+id/btnEqual"
android:text="@string/equal"
android:layout_marginRight="1pt"
android:layout_height="30pt"
android:layout_weight="1"
android:onClick="equalEvent"
android:textColor="@color/white"
android:layout_width="30pt"
android:background="@color/purple_200"
></Button>
</TableRow>
</TableLayout>
</LinearLayout>

19
JAVA FILE
package com.example.tutorial;
import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {


boolean isNewOperator = true;
EditText edt1;
String operator = "+";
String initialNumber = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

edt1 = findViewById(R.id.editText);
}
public void numberEvent(View view) {
if(isNewOperator)
edt1.setText("");
isNewOperator = false;
String number = edt1.getText().toString();
if(view.getId() == R.id.btnOne){
number += "1";
}
else if(view.getId() == R.id.btnTwo){
number += "2";
}
else if(view.getId() == R.id.btnThree){
number += "3";
}
else if(view.getId() == R.id.btnFour){
20
number += "4";
}
else if(view.getId() == R.id.btnFive){
number += "5";
}
else if(view.getId() == R.id.btnSix){
number += "6";
}
else if(view.getId() == R.id.btnSeven){
number += "7";
}
else if(view.getId() == R.id.btnEight){
number += "8";
}
else if(view.getId() == R.id.btnNine){
number += "9";
}
else if(view.getId() == R.id.btnZero){
number += "0";
}

else if(view.getId() == R.id.btnDot){


number += ".";
}
edt1.setText(number);
}
public void operatorEvent(View view) {
isNewOperator =true;
initialNumber = edt1.getText().toString();
if(view.getId() == R.id.btnMultiply){
operator = "*";}
else if(view.getId() == R.id.btnMinus){
operator = "-";}
else if(view.getId() == R.id.btnDivide){
operator = "/";}
21
else if(view.getId() == R.id.btnPlus){
operator = "+";
}}
public void equalEvent(View view) {
String newNumber = edt1.getText().toString();
double output = 0.0;
if(operator == "+")
output = Double.parseDouble(initialNumber) +
Double.parseDouble(newNumber);
if(operator == "/")
output = Double.parseDouble(initialNumber) /
Double.parseDouble(newNumber);
if(operator == "*")
output = Double.parseDouble(initialNumber) *
Double.parseDouble(newNumber);

if(operator == "-")
output = Double.parseDouble(initialNumber) -
Double.parseDouble(newNumber);

edt1.setText(output+"");
}
public void clearEvent(View view) {
edt1.setText("0");
isNewOperator = true;
}
public void percentEvent(View view) {
double num = Double.parseDouble(edt1.getText().toString())/100;
edt1.setText(num+"");
isNewOperator = true;

}
}

22
OUTPUT

Home Screen Addition of 10 + 10

23
Multiplicatin of 4*2 Division of 10/2

24
CONCLUSION

So in this Project , we have learned how to create a simple


calculator app in android studio. This is a good android project for
beginners like me , as it will increase my ability to apply logic while
coding. With the development of technology, use of software is
preferred to manual hand calculation of number. Although this
Calculator Android Project is developed as a semester Android app
development project, it seems to have bright future and scope in all
Android devices.

25
REFERENCE

 https://www.javatpoint.com/
 https://www.javatpoint.com/android-tutorial
 https://www.javatpoint.com/android-what-where-and-why
 https://www.android.com/intl/en_in/
 https://developer.android.com/studio
 https://en.wikipedia.org/wiki/Android
 https://projectworlds.in/android-projects-with-source-code/age-
calculator-android-with-source-code/
 https://www.geeksforgeeks.org/how-to-build--calculator-in-
android-studio/
 https://play.google.com/store/apps/details?id=com.ng_labs.agec
alculator&hl=en_IN&gl=US

26

You might also like