0% found this document useful (0 votes)
10 views54 pages

reference documents for mini projects

Uploaded by

bindiyap
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)
10 views54 pages

reference documents for mini projects

Uploaded by

bindiyap
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/ 54

VISVESVARYA TECHNOLOGICAL UNIVERSITY

Jnana Sangama, Belagavi-


590018

Mini Project Report on

“BMI CALCULATOR”

Submitted in the partial fulfillment of the requirement for the award degree
of

BACHELOR OF ENGINEERING
in
COMPUTER SCIENCE & ENGINEERING

Submitted By

Ms. ABC 1AR20CS


Ms. ABC 1AR20CS

Under the Guidance of

ABC
Prof. of CSE Dept.
AIEMS, Bengaluru.

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING


2022-23
B.V.V. Sangha’s
AMRUTA INSTITUTE OF ENGINEERING & MANAGEMENT SCIENCES
Bidadi Industrial Area, Bidadi, Bengaluru – 562109
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE

This is to certify that the mini project report entitled “SOLAR SYSTEM” is a
Bonafide project work carried out by ABC (1AR20CS) and ABC (1AR20CS) in
partial fulfilment of award of Degree of Bachelor of Engineering in Computer Science
and Engineering of Visvesvaraya Technological University, Belagavi, during the
academic year 2022-2023. It is certified that all corrections/suggestions indicated for
Internal Assessment have been incorporated. The mini project has been approved as it
satisfies the academic requirements associated with the Degree mentioned.

Signature of Guide Signature of Project


Co-Ordinator

…………………… …………………
ABC ABC
Prof., of CSE Dept., Prof., of CSE Dept.,
AIEMS, Bengaluru. AIEMS, Bengaluru.

Signature of HOD Signature of Principal

………………… …………………
ABC
ABC
Head, Dept. of CSE Principal
AIEMS, Bengaluru AIEMS, Bengaluru
ACKNOWLEDGEMENT

The completion of project brings with great sense of satisfaction, but it is never completed
without thanking the persons who all are responsible for its successful completion. First
and foremost, I wish to express my deep sincere feelings of gratitude to our Institution,
AMRUTA INSTITUTE OF ENGINEERING & MANAGEMENT SCIENCES, for
Providing me an opportunity to do my education.

I extend my deep sense of sincere gratitude to Dr. SANTOSH MURNAL, Principal


AMRUTA INSTITUTE OF ENGINEERING & MANAGEMENT SCIENCES, for
having
permitted to carry out the project work successfully.

I express my heartfelt sincere gratitude to Prof.ABC Professor and Head of Department of


Computer Science and Engineering, AMRUTA INSTITUTE OF ENGINEERING &
MANAGEMENT SCIENCES, for his valuable suggestions and support.

I express my special in-depth, heartfelt, sincere gratitude to project Prof. Guide Name
Professor of CS&E, AMRUTA INSTITUTE OF ENGINEERING & MANAGEMENT
SCIENCES, for his constant support.

Finally, I would like to thank all the Teaching, Technical faculty and supporting staff
members of Department of Computer Science and Engineering, AMRUTA INSTITUTE
OF ENGINEERING & MANAGEMENT SCIENCES, for their support.

ABC
(1AR20CS)
ABC
(1AR20CS)

i
DECLARATION

ABC (1AR20CS) & ABC (1AR20CS) student of sixth semester Bachelor of Engineering in
the Department of Computer Science and Engineering of AMRUTA INSTITUTE OF
ENGINEERING & MANAGEMENT SCIENCES,
BIDADI, bengaluru-562109, Karnataka , hereby declare that the project entitled “BMI

CALCULATOR” has been carried out by me under the guidance and supervision of

Internal Guide C.M. JANGIN, Professor, Department of Computer Science and

Engineering, AIEMS, Bengaluru, submitted in the fulfilment of the requirements for the

course requirements for the award of the degree of Bachelor of Engineering of Computer

Science and Engineering of Visvesvaraya Technological University during the Academic

year 2022-23.

Place:

Date:

ABC

(1AR20CS009
)
ABC
(1AR20CS012)

ii
INDEX
Chapters Content Page no.

Acknowledgement i
Declaration ii
1 Introduction 1
1.1 Problem Statement 1
1.2 Scope 1
1.3 Project Description 2

2 Hardware & Software 3


requirement

2.1 Hardware Requirement 3


2.2 Software Requirement 3
3 Design 4
3.1 System Design 4

4 Implementation 10

5 Result and Conclusion 32

6 Future Enhancement 36

7 Conclusion 38

8 Bibliography 39
BMI CALCULATOR 2022-23

CHAPTER 1

INTRODUCTION

1.1 Problem statement/ Aim

BMI is a measurement of a person's leanness or corpulence based on their height and


weight, and is intended to quantify tissue mass. It is widely used as a general indicator of
whether a person has a healthy body weight for their height. Specifically, thevalue
obtained from the calculation of BMI is used to categorize whether a person is
underweight, normal weight, overweight, or obese depending on what range the value
falls between. These ranges of BMI vary based on factors such as region and age, and
aresometimes further divided into subcategories such as severely underweight or very
severely obese. Being overweight or underweight can have significant health effects, so
while BMI is an imperfect measure of healthy body weight, it is a useful indicator of
whether any additional testing or action is required. Refer to the table below to see the
different categories based on BMI that are used by the calculator.
 significantlyimprove our understanding of the strengths and limitations of the
measuresused to define obesity,
 define the characteristics of the populations required to develop an
internationalreference population, and
 help specify the research agenda necessary to validate the definition of obesity that
wehave proposed.

1.2 Scope
Becoming overweight should be avoided by everyone. But for persons with disabilities
becoming overweight is a strict NO! Those extra kilos on your body can make you even
more disabled. Increased weight will not just hamper your mobility, but also it will cause
problems to your bones and muscles. And then those risks of diabetes, hypertension and
stroke etc. are also there to cause problems. You can always keep an eye on your weight
by regularly using a weighing machine. But how exactly would you know How would
you know if you’re overweight or obese? Well, Body Mass Index (BMI) is one ofthe
globally accepted standards of defining obesity.

Dept. Of CS&E,
AIeMS Page | 1
BMI CALCULATOR 2022-23

1.3 Project description

Body mass index: A key index for relating weight to height. Abbreviated BMI. BMI is a
person's weight in kilograms (kg) divided by his or her height in meters squared. The
National Institutes of Health (NIH) now defines normal weight, overweight, and
obesity according to BMI rather than the traditional height/weight charts.

 Overweight is a BMI of 27.3 or more for women and 27.8 or more for men.

 Obesity is a BMI of 30 or more for either sex (about 30 pounds overweight).

 A very muscular person might have a high BMI without health risks.

Dept. Of CS&E,
AIeMS Page | 2
BMI CALCULATOR 2022-23

CHAPTER 2

HARDWARE & SOFTWARE REQUIREMENTS

2.1 HARDWARE REQUIREMENTS

 8 GB DDR4 memory.

 64-bit Microsoft® Windows® 8/10.

 100 GB free disk space at minimum, 120 GB recommended.

 Core CPU processor with minimum 1.6 GHz or x86_64 CPU architecture; 2ndgeneration
Intel Core or newer, or AMD CPU with support for a Windows Hypervisor.
 Graphic Accelerators: NVidia or ATI with support of OpenGL 1.5 or higher.

 Monitor: EGVGA Compatible.

 Keyboard: Standard 101 key Keyboard.

 USB Mouse.

2.2 SYSTEM SOFTWARE REQUIREMENTS

 Operating System - Windows/Linux/Mac.

 Programming Language – Java.

 JDK -13.1 or higher.

 IDE - Android Studio 2019.

Dept. Of CS&E,
AIeMS Page | 3
BMI CALCULATOR 2022-23

CHAPTER 3
DESIGN
3.1 SYSTEM DESIGN

In this mini project by using java as a programming language we are creating an


BMI(Body Mass Index) application that calculates underweight or over weight obese
accordingto your age, height and weight.

JAVA

Android applications are developed using the Java language. As of now, that’s really
only option for native applications. Java is a very popular programming language
developed by Sun Microsystems (now owned by Oracle). Developed long after C and C+
+, Java incorporates many of the powerful features of those powerful languages while
addressing some of their drawbacks. Still, programming languages are only as powerful
as their libraries. These libraries exist to help developers build applications.
Some of the Java’s important core features are:

 It’s easy to learn and understand

 It’s designed to be platform-independent and secure, using virtual machines.

 It’s object-oriented

Android relies heavily on these Java fundamentals. The Android SDK includes many
standard Java libraries (data structure libraries, math libraries, graphics libraries,
networking libraries and everything else you could want) as well as special Android
libraries that will help you develop awesome Android applications.

3.2 BODY MASS INDEX

The body mass index (BMI) is a method of assessing whether a person is a healthy weight
in relation to their height. Some experts call it the Queenlet index. Using the
person'sheight and weight, BMI indicates whether an individual is underweight, a healthy
weight, overweight, or obese. BMI has become the standard method for assessing body
weight in many countries across the world. However, there are some Where using BMI
may not be appropriate or accurate.

Dept. Of CS&E,
AIeMS Page | 4
BMI CALCULATOR 2022-23

3.2.3 How is BMI calculated?


To calculate a person's body mass index, they will need their height in meters andtheir
body weight in kilograms. Their weight is divided by their height squared to arrive at a
numerical value. There are many online tools that can calculate BMI easily.

Figure 3.1: Data flow/ process


diagram

Everyone wants to have an ideal body weight. However, there are many people who do
not know whether they are ideal or not. People usually weight themselves to know
theirweight status. However, there is a better way that is using Body Mass Index or better
knownas BMI. If you know your body mass index, you will know whether you are ideal
or not. Therefore, this is the better site to calculate your weight or health status.

Figure 3.2: Calculation results with weight status

Dept. Of CS&E,
AIeMS Page | 5
BMI CALCULATOR 2022-23

3.2.4 The Categories of Body Mass Index

Body mass index relates to height and weight It is classified into 4 different categories.
The first category is underweight. People belong to underweight category if they have
less than
18.5 BMI. The second category is normal weight. People belong to normal weight
category if their BMI is in the range from 18.5 to 24.9. The third categoryis overweight
where people’s BMI is in the range from 25 to 29.9. The last one is obese where people’s
BMI is 30 or higher. If you know how to calculate Body Mass Index (BMI),you will
know what you belong to.

3.2.5 Who Can Calculate BMI?


There are many people who still do not understand about BMI. As it has been mentioned
before, BMI is your body mass that you should calculate to measure your weight
category. So, who can calculate it? It can also be calculated by your own. Everyone can
calculate his or her own BMI. You do not need to go to doctor or anyone else to do it as
long as you know how to calculate body mass index. So, you have to know the formula
and it is easy to practice.

3.2.5.1 Risks associated with being overweight

Being overweight increases the risk of a number of serious diseases and healthconditions.
Below is a list of said risks, according to the Centers for Disease Control and Prevention
(CDC):
Higher levels of LDL cholesterol, which is widely considered "bad cholesterol, lower
levels of HDL cholesterol, considered to be good cholesterol in moderation, and
highlevels of triglycerides
 Type II diabetes

 Coronary heart disease

 Stroke

 Gallbladder disease

 Osteoarthritis, a type of joint disease caused by breakdown of joint cartilage

Dept. Of CS&E,
AIeMS Page | 6
BMI CALCULATOR 2022-23

Generally, an increased risk of mortality compared to those with a healthy BMI As can be
seen from the list above, there are numerous negative, in some cases fatal, outcomes that
may result from being overweight. Generally, a person should try to maintain BMI below
25 kg/m2,but ideally should consult their doctor to determine whether or Northey need to
make any changes to their lifestyle in order to be healthier.

Risks associated with being underweight

 Being underweight has its own associated risks, listed below:

 Malnutrition, vitamin deficiencies, anemia (lowered ability to carry blood vessels)

 Osteoporosis, a disease that causes bone weakness, increasing the risk of breakinga bone
 A decrease in immune function

 Growth and development issues, particularly in children and teenagers

 Possible reproductive issues for women due to hormonal imbalances that can disrupt the
menstrual cycle. Underweight women also have a higher chance of miscarriage in the
first trimester
 Potential complications as a result of surgery

 Generally, an increased risk of mortality compared to those with a healthy BMI

 In some cases, being underweight can be a sign of some underlying condition


ordisease such as anorexia nervosa, which has its own risks. Consult your doctor if you
think you orsomeone you know is underweight, particularly if the reason for being
underweight does not seem obvious.

Dept. Of CS&E,
AIeMS Page | 7
BMI CALCULATOR 2022-23

3.2.4 USER INTERFACE

Figure 3.3: layout design for BMI calculator

 Here is a BMI Calculator which collects submitter name, age, gender information with
their height and weight measurements and provides them with their body measurement
index and body type information. The template can be used both by individuals who
would like to measure their BMI score and also by dietitians to track their patient
records.

Dept. Of CS&E,
AIeMS Page | 8
BMI CALCULATOR 2022-23

Figure 3.4: layout design for results

 Body mass index, or BMI, is a measure of body size. It combines a person’s weightwith
their height. The result of BMI measurement can give an idea about whether aperson has
the correct weight for their height.

Dept. Of CS&E,
AIeMS Page | 9
BMI CALCULATOR 2022-23

CHAPTER 4
IMPLEMENTATION

4.1 Code Snippets

1. Mainactivity.java & activity_main.xml:


Activity_main.xml is main xml file of this application where it displays all the functions
required to collect the BMI data from the user. Mainactivity.java is responsible for
gathering user data and calculating BMI results which then passed to the Bmiactivity.java
and its respective xml file for displaying the results to the user.

Mainactivity.java
package com.tarun.bmicalculator;
import androidx.appcompat.app.AppCompatActivity;

import androidx.cardview.widget.CardView;
import android.content.Intent;import android.os.Bundle;
import android.view.View; import android.widget.Button;
import android.widget.NumberPicker;import
android.widget.TextView; import android.widget.Toast;
importcom.google.android.material.floatingactionbutton.FloatingActionButton;import
java.text.DecimalFormat;
public class MainActivity extends AppCompatActivity implementsView.OnClickListener
{
CardView weightCardView;CardView ageCardView;
TextView weightCounterText, ageCounterText,
height_title_text;FloatingActionButton weightBtnInc, ageBtnInc;
FloatingActionButton weightBtnDec,
ageBtnDec; int weightCounter = 50;int
ageCounter = 25; String countWeight, countAge;
NumberPicker feetPicker, inchPicker;int feetValue = 5 , inchValue = 4; Button
calculateBtn;

String heightValue; DecimalFormat decimalFormat;

Dept. Of CS&E,
AIeMS Page | 10
BMI CALCULATOR 2022-23
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView(R.layout.activity_main); weightCardView =
findViewById(R.id.weight_cardView); ageCardView =
findViewById(R.id.age_cardView); weightCounterText =
findViewById(R.id.weight_counter_text); ageCounterText =
findViewById(R.id.age_counter_text); weightBtnInc =
findViewById(R.id.weight_btn_inc);
weightBtnDec =
findViewById(R.id.weight_btn_dec); ageBtnInc =
findViewById(R.id.age_btn_inc); ageBtnDec =
findViewById(R.id.age_btn_dec); feetPicker =
findViewById(R.id.feet_picker); inchPicker =
findViewById(R.id.inch_picker);
height_title_text =
findViewById(R.id.height_title_text); calculateBtn =
findViewById(R.id.calculate_btn); counterInit();
decimalFormat = new
DecimalFormat(".#");
weightCardView.setOnClickListener(this);
ageCardView.setOnClickListener(this);
weightBtnInc.setOnClickListener(this);
weightBtnDec.setOnClickListener(this);
ageBtnInc.setOnClickListener(this);
ageBtnDec.setOnClickListener(this);

feetPicker.setOnValueChangedListener(
new NumberPicker.OnValueChangeListener() {@Override
public void onValueChange(NumberPicker picker, int oldVal, int newVal)
{ feetValue = newVal;
heightValueIs();

Dept. Of CS&E,
AIeMS Page | 11
BMI CALCULATOR 2022-23

}
});

inchPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
{ @Override
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {inchValue
= newVal;
heightValueIs();
}
});
calculateBtn.setOnClickListener(new View.OnClickListener()
{@Override public void onClick(View v) {calculateBmi();
}
});
}

@Override
public void onClick(View v) {switch (v.getId())
{
case R.id.weight_cardView:
break;
case R.id.weight_btn_inc:if(weightCounter < 700) weightCounter+
+; countWeight = Integer.toString(weightCounter);
weightCounterText.setText(countWeight); break;
case R.id.weight_btn_dec:if(weightCounter > 0)
weightCounter--; countWeight =
Integer.toString(weightCounter);
weightCounterText.setText(countWeight);break;
case R.id.age_cardView:
break;
case R.id.age_btn_inc:

Dept. Of CS&E,
AIeMS Page | 12
BMI CALCULATOR 2022-23
if(ageCounter <
150) ageCounter++;
countAge =
Integer.toString(ageCounter);
ageCounterText.setText(countAge);
break;
case
R.id.age_btn_dec:
if(ageCounter > 1)
ageCounter--;
countAge =
Integer.toString(ageCounter);
ageCounterText.setText(countAge);
break;
}
}

private void counterInit() {


countWeight =
Integer.toString(weightCounter);
weightCounterText.setText(countWeight);
countAge = Integer.toString(ageCounter);
ageCounterText.setText(countAge);
feetPicker.setMinValue(1);
feetPicker.setMaxValue(8);
inchPicker.setMinValue(0);
inchPicker.setMaxValue(11);
feetPicker.setValue(5);
inchPicker.setValue(4)
; heightValueIs();
}
public void heightValueIs()
{
if(inchValue == 0){

Dept. Of CS&E,
AIeMS Page | 13
BMI CALCULATOR 2022-23

heightValue = feetValue + " feet ";


height_title_text.setText(heightValue)
;
}
else

Dept. Of CS&E,
AIeMS Page | 14
BMI CALCULATOR 2022-23

heightValue = feetValue + " feet " + inchValue +"


inches"; height_title_text.setText(heightValue);
}
public void calculateBmi(){
double heightInInches = feetValue * 12 +
inchValue; double heightInMetres = heightInInches /
39.37;
double heightInMetreSq = heightInMetres *
heightInMetres; double bmi = weightCounter /
heightInMetreSq;
String bmiValue = decimalFormat.format(bmi);
Intent intent = new
Intent(this,BmiActivity.class);
intent.putExtra("bmiVal",bmiValue);
startActivity(intent);
}

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"
tools:context=".MainActivity"
android:background="@color/background">

<TextView
android:id="@+id/title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content
" android:layout_marginTop="14dp"

Dept. Of CS&E,
AIeMS Page | 15
BMI CALCULATOR 2022-23
android:fontFamily="sans-serif-condensed-light"
android:text="@string/title_text"
android:textAppearance="@style/TextAppearance.AppCompat.Display1
" android:textColor="@color/text_color"
android:textSize="36sp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.cardview.widget.CardView
android:id="@+id/weight_cardView"
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_marginStart="12dp"
android:layout_marginTop="76dp"
android:background="@color/bg_layer_2"
app:cardCornerRadius="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title_text"
>
<androidx.constraintlayout.widget.ConstraintLayou
t android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_layer_2">

<TextView
android:id="@+id/weight_counter_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:text="@string/weight_counter_txt"
android:textAlignment="center"
android:textColor="@color/text_color"

Dept. Of CS&E,
AIeMS Page | 16
BMI CALCULATOR 2022-23
android:textSize="60sp"

Dept. Of CS&E,
AIeMS Page | 17
BMI CALCULATOR 2022-23
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/weight_title_text" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:padding="8dp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<com.google.android.material.floatingactionbutton.FloatingActionButto
n android:id="@+id/weight_btn_inc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
app:backgroundTint="@color/bg_layer_3
" app:maxImageSize="35dp"
app:srcCompat="@drawable/ic_add"
tools:layout_editor_absoluteX="32dp"
tools:layout_editor_absoluteY="128dp" />

<View
android:layout_width="20dp"
android:layout_height="0dp" />

<com.google.android.material.floatingactionbutton.FloatingActionButto
n android:id="@+id/weight_btn_dec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:backgroundTint="@color/bg_layer_3"

Dept. Of CS&E,
AIeMS Page | 18
BMI CALCULATOR 2022-23
app:maxImageSize="35dp"
app:srcCompat="@drawable/ic_remove"
tools:layout_editor_absoluteX="120dp"
tools:layout_editor_absoluteY="128dp" /
>
</LinearLayout>

<TextView
android:id="@+id/weight_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/weight_title_txt"
android:textColor="@color/text_color"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/age_cardView"
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_marginTop="76dp"
android:layout_marginEnd="12dp"
android:background="@color/bg_layer_2"
android:visibility="visible"
app:cardCornerRadius="20dp"
app:layout_constraintEnd_toEndOf="parent
"
app:layout_constraintTop_toBottomOf="@+id/title_text">

<androidx.constraintlayout.widget.ConstraintLayou

Dept. Of CS&E,
AIeMS Page | 19
BMI CALCULATOR 2022-23
t android:layout_width="match_parent"
android:layout_height="match_parent"

Dept. Of CS&E,
AIeMS Page | 20
BMI CALCULATOR 2022-23
android:background="@color/bg_layer_2">

<TextView
android:id="@+id/age_counter_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:text="@string/age_counter_txt"
android:textAlignment="center"
android:textColor="@color/text_color"
android:textSize="60sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.505"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:padding="8dp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<com.google.android.material.floatingactionbutton.FloatingActionButto
n android:id="@+id/age_btn_inc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
app:backgroundTint="@color/bg_layer_3
" app:maxImageSize="35dp"
app:srcCompat="@drawable/ic_add"

Dept. Of CS&E,
AIeMS Page | 21
BMI CALCULATOR 2022-23
tools:layout_editor_absoluteX="32dp"
tools:layout_editor_absoluteY="128dp" /
>

<View
android:layout_width="20dp"
android:layout_height="0dp" />

<com.google.android.material.floatingactionbutton.FloatingActionButto
n android:id="@+id/age_btn_dec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:backgroundTint="@color/bg_layer_3
" app:maxImageSize="35dp"
app:srcCompat="@drawable/ic_remove"
tools:layout_editor_absoluteX="120dp"
tools:layout_editor_absoluteY="128dp" />
</LinearLayout>

<TextView
android:id="@+id/age_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/age_title_txt"
android:textColor="@color/text_color"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent
"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /
>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardVie
Dept. Of CS&E,
AIeMS Page | 22
BMI CALCULATOR 2022-23
w
android:id="@+id/height_cardView"
android:layout_width="334dp"

Dept. Of CS&E,
AIeMS Page | 23
BMI CALCULATOR 2022-23
android:layout_height="220dp"
android:layout_marginTop="32dp"
android:background="@color/bg_layer_2"
app:cardCornerRadius="22dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent
"
app:layout_constraintTop_toBottomOf="@+id/weight_cardView">

<androidx.constraintlayout.widget.ConstraintLayou
t android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_layer_2">

<TextView
android:id="@+id/height_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/height_title_txt"
android:textColor="@color/text_color"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502
"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent
"
app:layout_constraintTop_toBottomOf="@+id/height_title_text">
Dept. Of CS&E,
AIeMS Page | 24
BMI CALCULATOR 2022-23

<androidx.cardview.widget.CardVie
w android:id="@+id/feet_cardView"

Dept. Of CS&E,
AIeMS Page | 25
BMI CALCULATOR 2022-23
android:layout_width="120dp"
android:layout_height="140dp"
android:layout_marginStart="24dp"
android:layout_weight="1"
app:cardCornerRadius="20dp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayou
t android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_layer_3">

<NumberPicker

android:id="@+id/feet_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:theme="@style/NumberPickerTheme"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/feet_title
" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/feet_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="@string/ft"
android:textColor="@color/text_color
" android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"

Dept. Of CS&E,
AIeMS Page | 26
BMI CALCULATOR 2022-23

app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>

<View
android:layout_width="24dp"
android:layout_height="0dp" />

<androidx.cardview.widget.CardView
android:id="@+id/inch_cardView"
android:layout_width="120dp"
android:layout_height="140dp"
android:layout_marginEnd="24dp"
android:layout_weight="1"
app:cardCornerRadius="20dp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">

<androidx.constraintlayout.widget.ConstraintLayou
t android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_layer_3">

<NumberPicker
android:id="@+id/inch_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:theme="@style/NumberPickerTheme
"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/inch_titile
" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Dept. Of CS&E,
AIeMS Page | 27
BMI CALCULATOR 2022-23

<TextView
android:id="@+id/inch_titile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="@string/in"
android:textColor="@color/text_color
" android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/height"
android:textColor="@color/text_color
" android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<Button
android:id="@+id/calculate_btn"
android:layout_width="330dp"
android:layout_height="wrap_content
"
android:layout_marginBottom="24dp"
Dept. Of CS&E,
AIeMS Page | 28
BMI CALCULATOR 2022-23
android:background="@drawable/button_design"

Dept. Of CS&E,
AIeMS Page | 29
BMI CALCULATOR 2022-23
android:text="@string/button_text"
android:textColor="@color/text_color"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

1. BMIactivity.java & Activity_bmi.xml:


Activity_bmi.xml is responsible for displaying the final data to the user it also displays
appropriate message depending upon the BMI score. BMIactivity.java contains necessary
function which is used to display the message depending upon the BMI results to the user.

BMIActivity.java

package com.tarun.bmicalculator;

import
androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import
android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class BmiActivity extends AppCompatActivity


{ TextView bmiValue, bmiCategory,bmiTips;
String category;
String
bmiValOutput;
Button
calculateAgainBtn;
String[] bmiTipsArray;

Dept. Of CS&E,
AIeMS Page | 30
BMI CALCULATOR 2022-23
@Override
protected void onCreate(Bundle savedInstanceState) {

Dept. Of CS&E,
AIeMS Page | 31
BMI CALCULATOR 2022-23
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bmi);
bmiValue = findViewById(R.id.bmi_value);
bmiCategory =
findViewById(R.id.bmi_category); bmiTips =
findViewById(R.id.bmi_tips);
bmiTipsArray =
getResources().getStringArray(R.array.tips_array);
calculateAgainBtn = findViewById(R.id.calculate_again_btn);
bmiValOutput = getIntent().getStringExtra("bmiVal");
bmiValue.setText(bmiValOutput);
findCategory()
;
categoryTips();
calculateAgainBtn.setOnClickListener(new View.OnClickListener()
{ @Override
public void onClick(View v)
{ onBackPressed();
}
});
}
private void categoryTips() {
double result =
Double.parseDouble(bmiValOutput); if(result < 15)
{
bmiTips.setText(bmiTipsArray[0]);
}
else if(result >= 15 && result <= 16){
bmiTips.setText(bmiTipsArray[0]);
}
else if(result >= 16 && result <= 18.5){
bmiTips.setText(bmiTipsArray[1]);
}

Dept. Of CS&E,
AIeMS Page | 32
BMI CALCULATOR 2022-23
else if(result >= 18.5 && result <= 25){
bmiTips.setText(bmiTipsArray[2]);
}
else if(result >= 25 && result <= 30){

Dept. Of CS&E,
AIeMS Page | 33
BMI CALCULATOR 2022-23
bmiTips.setText(bmiTipsArray[3]);

}
else if(result >=30 && result <= 35){
bmiTips.setText(bmiTipsArray[4]);
}
else if(result >= 35 && result <= 50){
bmiTips.setText(bmiTipsArray[4]);
}
else
bmiTips.setText(bmiTipsArray[4])
;
}
private void findCategory() {
double result =
Double.parseDouble(bmiValOutput); if(result < 15)
{
category = "Very Severely
Underweight";
bmiCategory.setText(category);
}
else if(result >= 15 && result <= 16){
category = "Severely Underweight";
bmiCategory.setText(category);
}
else if(result >= 16 && result <= 18.5){
category = "Underweight";
bmiCategory.setText(category);
}
else if(result >= 18.5 && result <= 25)
{ category = "Normal (Healthy
weight)";
bmiCategory.setText(category);
}
else if(result >= 25 && result <= 30){
Dept. Of CS&E,
AIeMS Page | 34
BMI CALCULATOR 2022-23
category = "Overweight";
bmiCategory.setText(category);
}

Dept. Of CS&E,
AIeMS Page | 35
BMI CALCULATOR 2022-23
else if(result >=30 && result <= 35){
category = "Moderately Obese";
bmiCategory.setText(category);
}
else if(result >= 35 && result <= 50)
{ bmiCategory.setText(category);
category = "Severely Obese";
}
else
category = "Very Severely
Obese";
bmiCategory.setText(category);

}
}
Activity_bmi.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"
tools:context=".BmiActivity"
android:background="@color/background">

<TextView android:id="@+id/Bmi_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/YourBmiText"
android:textColor="@color/text_color"
android:textSize="36sp"
android:textStyle="bold"
android:layout_marginTop="36dp"
app:layout_constraintEnd_toEndOf="parent"
Dept. Of CS&E,
AIeMS Page | 36
BMI CALCULATOR 2022-23
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView android:id="@+id/bmi_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="88dp"
android:text="@string/bmiValue"
android:textColor="@color/text_color"
android:textSize="100sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent
"
app:layout_constraintTop_toBottomOf="@+id/Bmi_title" />

<TextView android:id="@+id/bmi_category"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="70dp"
android:textColor="@color/text_color"
android:textSize="26sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bmi_value" /
>

<TextView
android:id="@+id/bmi_tips"
android:layout_width="350dp
"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:text="@string/bmiTips"

Dept. Of CS&E,
AIeMS Page | 37
BMI CALCULATOR 2022-23
android:textAlignment="center"
android:textColor="@color/text_color
"

Dept. Of CS&E,
AIeMS Page | 38
BMI CALCULATOR 2022-23
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/bmi_category" />

<Button
android:id="@+id/calculate_again_btn
" android:layout_width="330dp"
android:layout_height="wrap_content"
android:background="@drawable/button_design"
android:text="@string/button2_text"
android:textColor="@color/text_color"
android:textSize="18sp"
android:layout_marginBottom="24dp"
app:layout_constraintBottom_toBottomOf="parent
" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

Dept. Of CS&E,
AIeMS Page | 39
BMI CALCULATOR 2022-23

CHAPTER 5

RESULTS AND CONCLUSTION

5.1 Snap shots

Figure 5.1: Calculating underweight Figure 5.2: Underweight results

In Figure5.1 & 5.2, Being underweight is defined as having a body mass index
(BMI) below 18.5. This is estimated to be less than the body mass needed to sustain
optimal health. Conversely, over 25 is considered overweight and over 30 is
considered obese. Use this calculator to see where you fit on the BMI scale

Dept. Of CS&E,
AIeMS Page | 40
BMI CALCULATOR 2022-23

Figure 5.3: Calculating normal weight Figure 5.4: Normal weight results

In Figure 5.3 & 5.4, Your BMI is, indicating your weight is in the category for
adults of your height. For your height, a normal weight range would be from to
pounds. Maintaining a healthy weight may reduce the risk of chronic diseases
associated with overweight and obesity.

Dept. Of CS&E,
AIeMS Page | 41
BMI CALCULATOR 2022-23

Figure 5.5: Calculating over weight Figure 5.6: Over weight results

In Figure 5.5 & 5.6, overweight is a BMI greater than or equal to 25; and obesityis
a BMI greater than or equal to 30. BMI provides the most useful population- level
measure of overweight and obesity as it is the same for both sexes and for allages
of adults.

Dept. Of CS&E,
AIeMS Page | 42
BMI CALCULATOR 2022-23

Figure 5.7: Calculating moderately Obese Figure 5.8: moderately Obese results

In Figure 5.7 & 5.8, Obesity (BMI ≥ 30 kg/m2) was observed in 8.9% of men and
12.4% of women; for moderate overweight (BMI 25-<30 kg/m2) these percentages
were 42.2% and 30.4% respectively. Obese men and women were more likely to
consult their GP than persons without overweight.

Dept. Of CS&E,
AIeMS Page | 43
BMI CALCULATOR 2022-23

Figure 5.9: Calculating severely obese Figure 5.10: severely obese result

In Figure 5.9 & 5.10, The actual medical definition of morbid obesity is: “A
serious health condition that results from an abnormally high body mass that is
diagnosed by having a body mass index (BMI) greater than 40 kg/m², a BMI of
greater than 35 kg/m² with at least one serious obesity-related condition, or being
more than 100 pounds over ideal body weight (IBW).”.

Dept. Of CS&E,
AIeMS Page | 44
BMI CALCULATOR 2022-23

Figure 5.11: Calculating very severely underweight Figure 5.12: very severely
underweight

In Figure 5.11 & 5.12, Very severely underweight This indicates that your body fat
percentage is in the DANGEROUSLY LOW category. You are VERY
SEVERELY UNDERWEIGHT and should be seen by a healthcare provider for
further assessment to determine possible causes of very severe underweight.

Dept. Of CS&E,
AIeMS Page | 45
BMI CALCULATOR 2022-23

CHAPTER 6
FUTURE ENHANCEMENTS

In future we can add features where user can share their results which each other
and then comparing their results. Giving health advice or tips in scheduled manner
depending on the user results. Providing best workout routine and food tips to be
fit. And a feature where the applicationshows gyms and fitness center near his/her
neighborhood using Google maps API.

 Multi-Unit Support: Provide the option to input height and weight in various
measurement units, such as centimeters and kilograms, feet and pounds, etc. This
will make the calculator more versatile and user-friendly for people who are more
comfortable with different unit systems.

 Age Consideration: Incorporate age as a factor in the BMI calculation. As


individuals age, their body composition and metabolic rates may change, and BMI
might not be the most accurate indicator of health. Adjusting the calculation to
account for age can provide more personalized results.

 Body Composition Analysis: Instead of relying solely on height and weight,


include additional factors such as body fat percentage, muscle mass, and waist
circumference to provide a more comprehensive assessment of overall health. This
could involve incorporatingadvanced body composition measurement methods like
bioelectrical impedance analysis or dual-energy X-ray absorptiometry.

 Health Risk Assessment: Expand the calculator to provide information on


associated health risks based on the BMI results. This could include a breakdown
of potential risks for conditions like cardiovascular disease, diabetes, or
hypertension, along with recommendations for further evaluation or lifestyle
changes.

 Visualizations and Trends: Create visual representations of BMI ranges to help


users better understand where they fall on the spectrum. Additionally, allow users
to track their BMI over time and provide trend analysis, allowing them to see
progress and changes in their health andweight management efforts.

Mobile App Integration: Develop a mobile application that integrates the BMI
calculator, providing a seamless user experience. The app could include additional

Dept. Of CS&E,
AIeMS Page | 46
BMI CALCULATOR 2022-23

features like reminders for regular measurements, personalized health


recommendations, and access to a database of nutritional information or exercise
programs.

 Integration with Wearable Devices: Sync the BMI calculator with wearable devices
like smartwatches or fitness trackers.

 This would enable automatic data input from these devices, making the calculation
process more convenient and accurate. It could also provide real-time feedback and
personalized recommendations based on the user's activity levels.

Dept. Of CS&E,
AIeMS Page | 47
BMI CALCULATOR 2022-23

CHAPTER
48

CONCLUSION

The aim of this project is to demonstrate the working of BMI application. The main
purpose ofthis application is to calculate the Body mass index or BMI of a person.
Body Mass Index (BMI), which is a measure of body fat, calculated using a
formula that requires the height andthe weight of an adult (either man or woman).
Persons with a BMI of less than 18.5 are underweight. A person is of normal
weight if his or her BMI is between 18.5 and 24.9; overweight if the BMI is
between 25 and 29.9; and obese if it is 30 and above. This application is helpful for
the people who are interested in working out and improving their health.

Dept. Of CS&E,
AIeMS Page | 48
BMI CALCULATOR 2022-23

CHAPTER
49

BIBILIOGRAPHY

1. Google Developer Training, "Android Developer Fundamentals Course

– Concept Reference”, Google Developer Training Team, 2017.


https://www.gitbook.com/book/googledeveloper- training/android-
developer- fundamentals-course-concepts/details .

2. Erik Hellman, “Android Programming – Pushing the Limits”.

3. Dawn Griffiths and David Griffiths, “Head First Android Development”.

4. J F DiMarzio, “Beginning Android Programming with Android Studio”.

5. Anubhav Pradhan, Anil V Deshpande, “Composing Mobile Apps”using Android.

www.github.com

www.google.com

www.freecodester.com

www.stackoverflow.com

Dept. Of CS&E,
AIeMS Page | 49

You might also like