0% found this document useful (0 votes)
110 views36 pages

"Develop An Android Calculator App.": Micro Project On

The document outlines a micro project focused on developing an Android Calculator app, submitted for a Diploma in Computer Engineering. The project aims to create a calculator that performs advanced calculations, stores previous results, and includes features like unit conversion and different operational modes. It details the resources required, project outcomes, and the development process using Android Studio.

Uploaded by

prajyot20naik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views36 pages

"Develop An Android Calculator App.": Micro Project On

The document outlines a micro project focused on developing an Android Calculator app, submitted for a Diploma in Computer Engineering. The project aims to create a calculator that performs advanced calculations, stores previous results, and includes features like unit conversion and different operational modes. It details the resources required, project outcomes, and the development process using Android Studio.

Uploaded by

prajyot20naik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 36

II

A
Micro Project
On
“Develop an Android Calculator app.”
Submitted in partial fulfillment of the requirement for the award of
Diploma of Engineering
In
Computer Engineering
By

Siddhesh Shirkar
Prajot Naik
Mehul Choudhari
Aditya Wagh
Tanasri Patil

under the guidance of

Ms. Sakshi Patil

Department of Computer

Engineering
2024-25
CERTIFICATE

VIVA COLLEGE OF DIPLOMA ENGINEERING & TECHNOLOGY


VIRAR

2024-25
This is to certify that the micro project entitled “Develop an Android Calculator app.”
has been submitted under the guidance of Karishma Datt in partial fulfillment of the
requirement for the award of Diploma of Engineering in Computer Engineering
from Maharashtra State Board of Technical Education.

“Develop an Android Calculator app.’’

GROUP MEMBERS

81. Siddhesh Shirker


82. Prajots Naik
83. Mehul Choudhari
84. Aditya Wagh
85. Tanasri Patil

Project Guide H.O.D


Ms. Sakshi Patil Mrs. Poonam Jadhav
INDEX

Sr. No. Name of the topic Page no.

PART –A PLAN

1 Brief Introduction
2 Aim of the Micro-Project
3 Resources Required

PART –B OUTCOMES

1 Brief Description
2 Aim of Micro-Project
3 Course Outcomes Integrated
4 Actual Procedure Followed
5 Actual Resources Used
6 Outputs of the Micro-Projects
7 Skill Developed/ learning out of this Micro-Project
Develop an Android Calculator app. MAD 22617, Sem 6

PART-A PLAN

1.0 Brief Introduction

Calculator med make calculation easier. But this android based calculator project will not do
only simple calculations bot more than that. This new android calculator will store your
mathematical operations and your answers in their memory by which you can check your results
and operations which you have performed earlier. To make complex task easier, some extra
features has been added in this android calculator and these are like unit conversion, fractional
cakculations, trigonometric calculations and unit conversion alsu. This caktulator will not only
work in single mode, but different versions available under one hood like users can switch to
sesentific type or to engineering type and mach more.

4
VIVA COLLEGE OF DIPLOMA ENGG &
TECH,
Develop an Android Calculator app. MAD 22617, Sem 6

2.0 AIM of Micro-Project

a) Fractional calculations can be easily performed using this android calculator.

b) Users will able to check their previous results in history sections and also able to send
it to memory for further process.

c) Grouping of digits and decimal points will be handling by this android calculator.

5
VIVA COLLEGE OF DIPLOMA ENGG &
TECH,
Develop an Android Calculator app. MAD 22617, Sem 6

3.0 Resources Required

Sr. No Name of Specification Qty Remarks


Resource

1 Computer Intel i3 Processor with 1


System 4GB RAM

2 Software Android Studio 1

6
VIVA COLLEGE OF DIPLOMA ENGG &
TECH,
Develop an Android Calculator app. MAD 22617, Sem 6

PART-B OUTCOME

1.0 Brief Description

Calculator med make calculation easier. But this android based calculator project will not do only simple
calculations bot more than that. This new android calculator will store your mathematical operations and
your answers in their memory by which you can check your results and operations which you have
performed earlier. To make complex task easier, some extra features has been added in this android
calculator and these are like unit conversion, fractional calculations, trigonometric calculations and unit
conversion also. This calculator will not only work in single mode, but different versions available under
one hood like users can switch to scientific type or to engineering type and much more.

Existing System:

All we know that, while using simple calculator, we don't able to get all these features at one place and
mostly rely on manual work. Because of this extensive manual work, there is some delay and if in resh
condition then not able to get the correct results. There sometimes for the purpose of numerical and
statistical numerical, we need to make conversion of results into octal or hexadecimal format. which again
not provided through normal or scientific calculator.

Proposed System:

It's the android calculator which will remember your all input, imo its memory and separate all your digits
with commas automatically, so that it can be easily. identified. Calculation is sometime boring, but its
interactive look and versatile fester will provide you an exciting calculation environment. Because of touchy
nature of your nature, using smart editor, you don't have to write everything. If there's an error, you can
click on location and rectify it. It will provide all the basic operations in normal mode, but users mode
display for their use. also choose the scientific mode or fixed.

Features of this project

1. Fractional calculations can be easily performed using this android calculator.

2. Users will able to check their previous results in history sections and also able to send it to memory for
further process.

3. Grouping of digits and decimal points will be handling by this android calculator.

4. Users will able to enter digits and operators which will also be displayed over the input panel.

5. Users can make conversions by using conversion unit section to make their calculation on hand.

7
Develop an Android Calculator app. MAD 22617, Sem 6

2.0 AIM of Micro-Project

a) Fractional calculations can be easily performed using this android calculator.

b) Users will able to check their previous results in history sections and also able to send
it to memory for further process.

c) Grouping of digits and decimal points will be handling by this android calculator

8
Develop an Android Calculator app. MAD 22617, Sem 6

3.0 Course Outcomes (CO)

a) Interpreter features of Android operating system.

b) Configure Android environment and development tools.

c) Develop rich user Interfaces by using layouts and controls.

4) Use User Interface components for android application development.

9
Develop an Android Calculator app. MAD 22617, Sem 6

4.0 Procedure Followed

Android App Development Fundamentals for Beginners

Android is an operating system that is built basically for Mobile phones. It is the Linux Kernel and
other open-source software and is developed by based Google. It is used for touchscreen mobile
devices such as smartphones and tablets but nowadays these ore used in Android Auto cars, TV,
watches, camera, etc. It has boon one of the best-selling OS for smartphones. Android OS was
developed by Android Inc. which Google bought in 2005. Various applications (apps) like games.
music player, camera, etc. are built for these smartphones for running on Android. Google Play
store features more than 3.3 million apps. The app is developed on an application known as
Android Studio. These executable apps are installed through a bundle or package called APK
(Android Package Kit).

Android Fundamentals

1. Android Programming Languages

In Android, basically, programming is done in two languages JAVA or C and XML


(Extension Markup Language). Nowadays KOTLIN is also preferred. The XML file deals
with the design, presentation, layouts, blueprint, etc. (as a front-end while the JAVA or
KOTLIN deals with the working of buttons, variables, storing, etc. (as a buck-end).

2. Android Componenta

The App components are the building blocks of Android. Each component has its own role and
life cycles Le from launching of an app till the end. Some of these components depend upon
others also.

Each component has a definite purpose. The four major app components are:

a) Activities
b) Services
c) Broadcast Receivers
d) Content Provider

Activities: It deals with the UI and the interactions to the screen. In other words, it is a User
Interface that contains activities, these can be one more depending upon the App. It starts when
the application is launched. At least one activity is always present which is known as
MainActivity.

The activity is implemented through the following.

Syntах:

10
Develop an Android Calculator app. MAD 22617, Sem 6
public class MainActivity extends Activity {

11
Develop an Android Calculator app. MAD 22617, Sem 6

// processes}

Services: Services are the background actives performed by the app, these might be long-running
operations like a user playing music whole surfing the Internet. A service might need other sub
services an to perform specific tasks. The main purpose of the Services is to provide non-stop
working of the app without breaking any interaction with the user.

Syntax:

public class MyServices extends Services {

// code for the services

Broadcast Receivers: A Broadcast is used to respond to messages from other applications or from
the System. For example, when the battery of the phone is low, then the Android OS fires a
Broadcasting message to launch the Battery Saver function se app, after receiving the message the
appropriate action is taken by the app. Broadcast Receiver is the subclass of BroadcastReceiver
class and each

Object is represented by Intent objects.

Syntax:

public class MyReceiver extends BroadcastReceiver

{ public void onReceivercontext.intent) {

Content Provider: Content Provider is used to transferring the data from one application to the
others at the request of the other application. These are handled by the class ContentResolver
class. This class implements a set of APIs (Application Programming tunerface) that enables the
other applications to perform the transactions. Any Content Provider mast implement the Parent
Class of

Content Provider class.

Syntax:

public class MyContentProvider extends ContentProvider {

public void onCreate ()

{}

}
12
Develop an Android Calculator app. MAD 22617, Sem 6
3. Structural Layout Of Android Studio

The basic structural layout of Android Studio is given below:

The above figure represents the various structure of un app

Manifest Folder: Android Manifest is an XML file that is the root of the project source set. It
describes the essential information about the app and the Android build tools, the Android Operating
System, and Google Play. It contains the permission that an app might need in order to perform a
specific task. It also contains the Hardware and the Software features of the app, which determines the
compatibility of an app on the Play Store. It also includes special activities like services, broadcast
receiver, content providers, package name, etc.

Java Folder: The JAVA folder consists of the java files that are required to perform the background
task of the app. It consists of the functionality of the buttons, calculation, storing, variables, variables,
toast (small popup message), programming function. The number of these files depends upon the type of
activities created.

Resource Folder: The res or Resource Folder consists of the various resources the used in the apathies
consists of sub-folders like draw able, layout, mipmap, raw, and values. The drawable consists of the
images. The layout consists of the XML, files that define the user interface layout. These are stored in
res.layout and are accessed as R.layout class. The raw consists of the Resources files like android files or
music files, etc. These accessed through R.row.filename, values used to store the hardcoded strings
(considered safe to store string values) values, integers, and colors It consists of various other directories
like:

13
Develop an Android Calculator app. MAD 22617, Sem 6

 R.array :arrays.xml for resource arrays


 R.integer: integers.xml for resource integers
 R.bool: bools.xml for resource boolean
 R.color: color xml for color values
 R.string :strings.xml for string values
 R.dimen :dimens.xml for dimension values
 R.style :styles.xml for styles

Gradle Files: Gradle is an advanced toolkit, which is used to manage the build process, that allows
defining the flexible custom build configurations. Each build configuration can define its own set of
code and resources while reusing the parts common to all versions of your app. The Android plugin for
Gradle works with the build toolkit to provide processes and configurable settings that are specific to
building and testing Android applications. Gradle and the Android plugin run independently of
Android Studies. This means that you can build your Android apps from within Android Studio. The
flexibility of the Android build system enables you to perform custom build configurations without
modifying your app's core source files.

Basic Layout Can be defined in a tree structure as:

Project/

app/

manifest/

AndroidManifest.xml

java/

MyActivity.java

res/

drawable/

icon.png

background.png

drawable-hdpi/

icon.png

background.png

layout/

14
Develop an Android Calculator app. MAD 22617, Sem 6

activity main.xml

info.xml

values/

strings.xml

4. Lifecycle of Activity in Android App

The Lifecycle of Activity in Android App can be shown through this diagram:

15
Develop an Android Calculator app. MAD 22617, Sem 6

States of Android Lifecycle:

1. OnCreate: This is called when activity is first created.

2. OnStart: This is called when the activity becomes visible to the user.

3. OnResume: This is called when the activity starts to interact with the user.

4. OnPause: This is called when activity is not visible to the user,

5. Onstop: This is called when activity in no longer visible.

6. Onflestart: This is called when activity is stopped, and restarted again.

7. OnDestroy: This is called when activity is to be closed or destroyed.

How to Install and Set up Android Studio on Windows?

Android Studio is the official IDE (Integrated Development Environment) for Android app development
and it based on JetBrains IntelliJ IDEA software. Android Studio provides many excellent features that
enhance productivity when building Android apps, such as:

 A blended environment where one develop for all Android devices


 Apply Changes to posh code and resource changes to the running app without restarting the app
 A flexible Gradle-based build system
 A fast and feature-rich emulator
 GitHub and Code template integration to assist you to develop common app features
and importsample code
 Extensive testing tools and frameworks.
 C++ and NDK support
 Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud
Messaging and App Engine, and many more.

System Requirements:

 Microsoft Windows 7/8/10 (32-bit or 64-bit)


 4 GB RAM mininsan, 8GB RAM recommended (plus 1 GiB for the Android Emulator)
 2 GB of available disk space minimum, 4 GB recommended (500 MB for IDE plus 1.5 GB
for Android
 SDK and emulator system image)
 1280 x 800 minimum screen resolution

16
Develop an Android Calculator app. MAD 22617, Sem 6

code for the activity main.xml file. activity_main.xml

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


<androidx.constraintlayout.widget.ConstraintLayout
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:background="8BC34A"
android:backgroundTint="@android:color/darker_gray"
tools:context=".MainActivity"/>

< TextView
android:layout_width="194dp"
android:layour_height="43dp"
android:layout_marginStart="114dp"
android:layuna_marginLeft="114dp"
android:layout_marginTop="58dp"
android:layour_marginEnd="103dp"
android:layout_marginRight="103dp"
android:layıma_marginBottom="502dp"
android:scrollbariaze="30dp"
android:text="Calculator"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textSize="30dp"
app:layout_constraintBottom_toBottomOf="parom"
app:layout_constraintEnd_to_EndOf="parent"
app:layout_constraintStart_StartOf="parent"
app:layout_constraint_Top_to_TopOf="parent">

< EditText

android:id="@+id/num1"
android:layout_width="364dp"
android:layout_height="2dp"
android:layuna_marginStart="724p"
android:layout_margin_Top="70dp"
android:layour_marginEnd="71dp"
android:layout_marginBottom="415dp"
android:background="@android:color/white"
android:ems="10"
android:onClick="clearTextNum1"
android:inputType="sumber"

17
Develop an Android Calculator app. MAD 22617, Sem 6

app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_EndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

< EditText

andmid:id="@num2"
android:layout_width="363dp"
android:layour_height="30dp"
android_layout_marginStart="72dp"
android_layuna_marginTop="112dp"
android:layout_marginlind="71dp"
android:layour_marginBotton="374dp"
android:background="@android:color/white"
android:ems="10"
android:onClick="clearTextNum2"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_StartOf="parent"
app:layout_constraint_Top_to_TopOf="parent"/>

< TextView

android:id="id/result"
android:layout_width="350dp"
android:layour_height="71dp"
android:layout_marginStart="41dp"
android:layout_marginTop="151dp"
android:layout_marginEnd="48dp"
android:layout_marginBottom="287dp"
android:background="@android:color/white"
android:text="result"
android:testColorLink="#673AB7"
android:textSize="25sp"
app:layout_constraintBottom_to_BottomOf="parent"
app:layout_constraintEnd_to_EndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

< Button

android:id="@+id/sum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
18
Develop an Android Calculator app. MAD 22617, Sem 6

android:layout_marginStart="16dp"
android:layout-margin-Top="292dp"
android:layout_marginEnd="307dp"
android:layout_marginBottoor="263dp"
android:backgroundTint="@android:color/holo_red _light"
android:onClick="dosum"
android:text="+"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_EndOf="parent"
app:layout_constraintStart_toštartOf="parent"
app:layout_constraintTop_to_TopOf="parent"/>

< Button

android:id="@+id/sub"
android:layout_width="wrap_conter"
android:layout_height="wrap_content"
android:layour_marginStart="210dp"
android:layout_marginTop="292dp"
android:layout_marginEnd="113dp"
android:layout_marginBottom="263dp"
android:backgroundTint="@android:color/holo_red_light"
android:onClick="doSub"
android:text="-"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constitaintEnd_toEndOf="parent"
app:layout_constraintHortzontal_bias="1.0"
app:layout_constraintStart_StartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.507"/>

< Button

android:id="@+id/div"
android:layour_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="307dp"
android:layout_marginTop="292dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="263dp"
android:backgroundTint="@android:color/holo_red_light"
android:onClick="doDiv"
android:text="/"
app:layout_constraintBottom_toBottomOf="parant"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
19
Develop an Android Calculator app. MAD 22617, Sem 6

app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

< Button

android:id="@+id/mul"
android:layout_width="wrap_conter"
android:layout_height="wrap_content"
android:layour_marginStart="16dp"
android:layout_marginTop="356dp"
android:layout_marginEnd="307dp"
android:layout_marginBottom="199dp"
android:backgroundTint="@android:color/holo_red_light"
android:onClick="doMul"
android:text="x"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constitaintEnd_toEndOf="parent"
app:layout_constraintStart_StartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

< Botten

android:id=“@+id/button"
android:layout_width=“103dp”
android:layout_height="46dp"
android:layout_marginStart=“113dp”
android:layout_marginTop=“356dp"
android:layout_marginEnd=“200dp"
android:layout_marginBottom="199dp"
android:backgroundTint=“@android.coloc/holo_red_light"
andround:onClick="doMod"
android:text=“%(mod)”
app:layout_constraintBottom_toBottonOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent”
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias=“0.515” />

<Button

android:id=“@+id/pow”
android:layout _width="wrap_content"
android:layout_height=“wrap_content”
android:layout_marginStart="113dp”
android:layout_marginTop=“292dp"
android:layout_marginEnd=“210dp"
20
Develop an Android Calculator app. MAD 22617, Sem 6

android:layout_marginBotton=“263dp”
android:backgroundTint=“@android:color/holo_red_light”
android:onClick="doPow"
android:text="nl^n2"
app:layout_constraintBottum_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias=“0.0”
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.507” />
</android.constantlayout.widget.ConstraintLayout>

File: MainActivity.java

package com.example.calculator2;
import android.os.Bundle;
import com.google.android.material.snackbar Snackbar;
import androidx.appcompat.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.View;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ul.AppBarConfigsiration;
import andruidx.navigation.ui.NavigationUI;
import com.example.calculator2.databinding.ActivityMainBinding;

import android.view.Menu;
import android.view.MenuItem;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity
{

private AppBarConfiguration appBarConfiguration;


private Activity MainBinding binding:
public EditText el,
e2; TextView t1;
int numl, num2;

public boolean getNumbers() {

//checkAndClear();
// defining the edit text 1 to el
21
Develop an Android Calculator app. MAD 22617, Sem 6
e1 = (EditText) findViewById(R.id.num1);

22
Develop an Android Calculator app. MAD 22617, Sem 6

// defining the edit text 2 to e2


e2 = (EditText) findViewById(R.id.num2);

//defining the text view to t1


t1= (TextView) findViewById(R.id.result);

//taking input from text box 1


String sl = e1.getText().toString();

//taking Input from text box 2


String s2 = e2.getText().toString();

if(s1.equals("Please enter value 1") && s2.equals(null))


{
String result ="Please enter value 2";
e2.setText(result);
return false;
}
if(s1.equals(null) && s2.equals("Please enter value 2"))
{
String result = "Please enter value 1";
el.setText(result);
return false;
}
if(s1.equals("Please enter value 1") || s2.equals("Please enter value 2”))
{
return false;
}
if((!s1.equals(null) && s2.equals(null))||(!s1.equals("") && s2.equals("")) )
{
String result = "Please enter value 2";
e2.setText(result);
return false;
}
if((s1.equals(null) && !s2.equals(null)) || (s1.equals("") && !s2.equals(“”)) )
{
//checkAndClear();
String result = "Please enter value 1";
el.setText(result);
return false;
}
if((s1.equals(null) && s2.equals(null)) || (s1.equals("") && s2.equals("")) )
{
//checkAndClear();
String result1 ="Please enter value 1";
el.setText(result 1);
String result2="Please enter value
2"; e2.setText(result2);
23
Develop an Android Calculator app. MAD 22617, Sem 6

return false;
}
else{
//converting string to int.
num1 = Integer.parseInt(sl);
//converting string to int.
num2 = Integer.parseInt(s2);
}
return true;
}
public void doSum(View v) {
//get the Input
numbers if
(getNumbers()) {
int sum=numl+nam2;
t1.setText Integer.toString(sum));
}
else
{
t1.setText("Error Please enter Required Values");
}
}
public void clear TextNuml(View v) {
// get the input numbers
el.getText().clear();
}
public void clear TextNam2(View v) {
// get the input numbers
e2.getText().clear();
}
public void doPow(View v) {
//check AndClear();
//get the input
numbers if
(getNumbers()) {
double sum Math.pow(num1, 2);
t1.setText(Double.toString(sum));
}
Else
{
t1.setText("Error Please enter Required Values");
}
}
//a public method to perform subtraction
public void doSub(View v) {
//checkAndClear();
//get the input
numbers if
24
Develop an Android Calculator app. MAD 22617, Sem 6
(getNumbers()) {
int sum = num1 - num2;
t1.setText(Integer.toString(sum));

25
Develop an Android Calculator app. MAD 22617, Sem 6

}
else
{
t1.setText("Error Picase enter Required Values");
}
}
//a public method to perform
moltiplication public void doMul(View v)
{
//check AndClear();
// get the input numbers
if (getNumbers()) {
int sum = numl * num2;
t1.setText(Integer.toString/sum));
}
else
{
t1.setText("Error Please enter Required Values");
}
}
//a public method to perform Division
public void doDiv(View v) {
//checkAndClear();
//get the input
numbers if
(getNumbers()) {

//displaying the text in text view assigned as t1


double sum = num1/(num2*1.0);
t1.setText(Double.toString(sum));
}
else
{
t1.setText("Error Please enter Required Values");
}
}
//a public method to perform modulus function
public void do Mod(View v) {
//checkAndClear();
//get the input
numbers if
(getNumbers()) {
double sum = num1 % num2;
t1.setText(Double.toString(sum));
}
else
{
t1.setText("Error Please enter Required Values");
26
Develop an Android Calculator app. MAD 22617, Sem 6
}
}

27
Develop an Android Calculator app. MAD 22617, Sem 6

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity main);
e1 = (EditText) findViewById(R.id.numl);
// defining the edit text 2 to 2
e2 = (EditText) findViewById(R.id.num2);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
//Inflate the menn; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(Menuftem item) {
//Handle action bar item clicks here. The actinn bar will
//automatically handle clicks on the Home/Up button, so long
//as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public boolean onSupportNavigateUp() {
NavController navController = Navigation.findNavController(this.
R.id.nav_hos_ fragment_content_main);
return NavigationUI.navigateUp(navController, appBarConfiguration)
|| super.onSupportNavigateUp();
}
}

28
Develop an Android Calculator app. MAD 22617, Sem 6

5.0 Resources Used

Name of Specification Qty Remarks


Resource

1 Computer Intel i3 Processor 1


with 4GB RAM

2 Software Android Studio 1

29
Develop an Android Calculator app. MAD 22617, Sem 6

6.0 Outputs of Micro-Projects

30
Develop an Android Calculator app. MAD 22617, Sem 6

31
Develop an Android Calculator app. MAD 22617, Sem 6

7.0 Skill Developed

a) Explain with relevant analogy the given Directory Structure.

b) Describe the steps to use the given Android rich UI component.

c) Describe the steps to use the given type of Layout.

d) Develop rich user Interfaces for the given Android application

32
Develop an Android Calculator app. MAD 22617, Sem 6

33
Develop an Android Calculator app. MAD 22617, Sem 6

34
Develop an Android Calculator app. MAD 22617, Sem 6

35
Develop an Android Calculator app. MAD 22617, Sem 6

36

You might also like