Micro-Project: Government Polytechnic Solapur
Micro-Project: Government Polytechnic Solapur
Micro-Project: Government Polytechnic Solapur
MICRO-PROJECT
MOBILE APPLICATION DEVELOPMENT
BMI CALCULATER
Page |1
CERTIFICATE
This is to certify that Mr. Yogesh Dharmasa Gangji . Of Sixth Semester
of Diploma in Computer Technology of Institute Government Polytechnic,
Solapur has completed the micro project work satisfactorily of Mobile
Application Development under the guidance of Ms.Sneiha mam for the
academic year 2021-2022 as prescribed in the I-Scheme curriculum.
Abstract
Acknowledgement
We wish to express our profound and sincere gratitude to our guide, Sneha
Ma’am who guided us in the structure of project as well as some main points in
that project also they cleared our all doubts about micro project. We are Indebted
to his constant encouragement, co-operation and help. It was his enthusiastic
support that helped us in overcoming various obstacles in the project.
BMI Calculator
7.0 Action Plan (Sequence and time required for major activities for 8 Weeks)
1. SL Mart
2. Ludo
3. BMI Calculator
Content Page
2 Aim 8
3 Resources Used 9
5 Actual Methodology 27
6 Advantages 27
7 Conclusion 28
8 Reference 29
Page |7
Introduction
The Android operating system is the largest installed base among various
mobile platforms across the globe. Hundreds of millions of mobile devices are
powered by Android in more than 190 countries of the world. It conquered around
75% of the global market share by the end of 2020, and this trend is growing
bigger every other day. The company named Open Handset Alliance developed
Android for the first time that is based on the modified version of the Linux kernel
and other open-source software. Google sponsored the project at initial stages and
in the year 2005, it acquired the whole company. In September 2008, the first
Android-powered device launched in the market. Android dominates the mobile
OS industry because of the long list of features it provides. It’s user-friendly, has
huge community support, provides a greater extent of customization, and a large
number of companies build Android-compatible smartphones. As a result, the
market observes a sharp increase in the demand for developing Android mobile
applications, and with that companies need smart developers with the right skill
set. At first, the purpose of Android was thought of as a mobile operating system.
However, with the advancement of code libraries and its popularity among
developers of the divergent domain, Android becomes an absolute set of software
for all devices like tablets, wearables, set-top boxes, smart TVs, notebooks, etc.
Aim
HARDWARE
RAM 8GB
SOFTWARE
OS WINDOWS 10
DOCUMENTATION MS-OFFICE
User requirements
RAM 3GB
STORAGE 100MB
INTERNET PERMSSION
LOACTION PREMISSION
P a g e | 10
Activity_Main.xml
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/centerhorizontalline"
android:layout_centerInParent="true">
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:id="@+id/centerverticalline">
</RelativeLayout>
<RelativeLayout
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_toStartOf="@id/centerverticalline"
android:background="@drawable/cardbackgroung"
android:layout_above="@id/heightlayout"
android:layout_marginBottom="35dp"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp"
android:id="@+id/male">
<ImageView
android:layout_width="170px"
android:layout_height="170px"
android:layout_above="@id/textmale"
android:layout_marginBottom="20dp"
android:layout_centerInParent="true"
android:src="@drawable/male"
android:contentDescription="@string/todo">
</ImageView>
<TextView
android:layout_width="match_parent"
P a g e | 11
android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="@color/white"
android:text="@string/male"
android:id="@+id/textmale"
android:textStyle="bold"
android:fontFamily="@font/raleway"
android:textAlignment="center"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp">
</TextView>
</RelativeLayout>
<RelativeLayout
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_above="@id/heightlayout"
android:layout_marginBottom="35dp"
android:layout_marginRight="20dp"
android:layout_toEndOf="@id/centerverticalline"
android:background="@drawable/cardbackgroung"
android:layout_marginLeft="20dp"
android:id="@+id/female">
<ImageView
android:layout_width="170px"
android:layout_height="170px"
android:layout_centerInParent="true"
android:layout_above="@id/textfemale"
android:layout_marginBottom="20dp"
android:src="@drawable/female"
android:contentDescription="@string/todo">
</ImageView>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="@color/white"
android:text="@string/femaletext"
android:id="@+id/textfemale"
android:textStyle="bold"
android:fontFamily="@font/raleway"
android:textAlignment="center"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp">
</TextView>
</RelativeLayout>
<RelativeLayout
android:layout_width="340dp"
android:layout_height="150dp"
P a g e | 12
android:layout_above="@id/centerhorizontalline"
android:layout_marginBottom="-50dp"
android:layout_centerHorizontal="true"
android:background="@drawable/cardbackgroung"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:id="@+id/heightlayout">
<TextView
android:layout_width="match_parent"
android:layout_marginTop="15dp"
android:textAlignment="center"
android:textStyle="bold"
android:fontFamily="@font/raleway"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:text="@string/height"
android:textSize="20sp">
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/startingheight"
android:layout_marginBottom="50dp"
android:textSize="40sp"
android:layout_alignParentBottom="true"
android:textColor="@color/white"
android:layout_centerInParent="true"
android:id="@+id/currentheight"
android:textStyle="bold">
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/unit"
android:textSize="20sp"
android:fontFamily="@font/raleway"
android:textStyle="bold"
android:layout_toEndOf="@id/currentheight"
android:layout_marginStart="20dp"
android:layout_centerInParent="true"
android:textColor="@color/white" />
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="20dp"
android:layout_marginLeft="10dp"
android:progressTint="#FF4C4C"
android:thumbTint="@color/white"
android:layout_marginRight="10dp"
android:id="@+id/seekbarforheight">
P a g e | 13
</SeekBar>
</RelativeLayout>
<android.widget.Button
android:layout_width="match_parent"
android:layout_height="40dp"
android:id="@+id/calculatebmi"
android:layout_alignParentBottom="true"
android:layout_marginBottom="15dp"
android:background="@drawable/buttonbackground"
android:text="@string/calculate_your_bmi"
android:textSize="15sp"
android:textColor="@color/white"
android:fontFamily="@font/raleway"
android:textStyle="bold"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
>
</android.widget.Button>
<RelativeLayout
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_toStartOf="@id/centerverticalline"
android:background="@drawable/cardbackgroung"
android:layout_below="@id/heightlayout"
android:layout_marginBottom="20dp"
android:layout_marginTop="85dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:id="@+id/weight">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="@color/white"
android:text="@string/weight"
android:fontFamily="@font/raleway"
android:id="@+id/textweight"
android:layout_marginTop="15dp"
android:textAlignment="center"
android:textStyle="bold"
android:layout_marginBottom="10dp">
</TextView>
<TextView
android:id="@+id/currentweight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
P a g e | 14
android:fontFamily="@font/raleway"
android:text="@string/startingweight"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="30sp"
android:textStyle="bold">
</TextView>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:layout_marginStart="20dp"
android:background="@drawable/plusminus"
>
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/minus"
android:id="@+id/decrementweight"
android:contentDescription="@string/todo">
</ImageView>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:layout_marginEnd="20dp"
android:layout_alignParentEnd="true"
android:background="@drawable/plusminus"
>
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:id="@+id/incremetweight"
android:src="@drawable/add"
android:contentDescription="@string/todo">
</ImageView>
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_toEndOf="@id/centerverticalline"
android:background="@drawable/cardbackgroung"
android:layout_below="@id/heightlayout"
android:layout_marginBottom="20dp"
P a g e | 15
android:layout_marginTop="85dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:id="@+id/Age">
<TextView
android:id="@+id/textage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18sp"
android:textColor="@color/white"
android:text="@string/age"
android:fontFamily="@font/raleway"
android:layout_marginTop="15dp"
android:textAlignment="center"
android:textStyle="bold"
android:layout_marginBottom="10dp">
</TextView>
<TextView
android:id="@+id/currentage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:fontFamily="@font/raleway"
android:text="@string/startingage"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="30sp"
android:textStyle="bold">
</TextView>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:layout_marginStart="20dp"
android:background="@drawable/plusminus"
>
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/minus"
android:id="@+id/decrementage"
android:contentDescription="@string/todo">
</ImageView>
</RelativeLayout>
P a g e | 16
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:layout_marginEnd="20dp"
android:layout_alignParentEnd="true"
android:background="@drawable/plusminus"
>
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:id="@+id/incrementage"
android:src="@drawable/add"
android:contentDescription="@string/todo">
</ImageView>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
Activity_bmiactivity.xml
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:id="@+id/imageview"
android:layout_above="@id/contentlayout"
android:layout_marginBottom="30dp"
android:layout_centerHorizontal="true"
android:src="@drawable/ok">
</ImageView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:id="@+id/contentlayout"
android:background="@drawable/cardbackgroung"
android:layout_centerInParent="true">
P a g e | 17
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="50sp"
android:textStyle="bold"
android:layout_centerHorizontal="true"
android:background="@color/trans"
android:textColor="@color/white"
android:id="@+id/bmidisplay"
android:text="22">
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Gender"
android:layout_marginTop="15dp"
android:textSize="17sp"
android:textStyle="bold"
android:layout_below="@id/bmidisplay"
android:layout_centerHorizontal="true"
android:textColor="@color/white"
android:id="@+id/genderdisplay" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Your BMI Category Is"
android:textStyle="bold"
android:id="@+id/bmicategorydispaly"
android:textColor="@color/white"
android:fontFamily="@font/raleway"
android:layout_marginTop="15dp"
android:layout_centerHorizontal="true"
android:layout_below="@id/genderdisplay"
android:textSize="25sp">
</TextView>
</RelativeLayout>
<android.widget.Button
android:layout_width="match_parent"
android:layout_height="40dp"
android:id="@+id/gotomain"
android:layout_below="@id/contentlayout"
android:layout_marginTop="50dp"
android:background="@drawable/buttonbackground"
android:text="RECALCULATE YOUR BMI"
android:textSize="15sp"
android:textColor="@color/white"
P a g e | 18
android:fontFamily="@font/raleway"
android:textStyle="bold"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
>
</android.widget.Button>
</RelativeLayout>
Main.java
package com.example.bmicalculator;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
TextView mcurrentheight;
TextView mcurrentweight,mcurrentage;
ImageView mincrementage,mdecrementage,mincrementweight,mdecrementweight;
SeekBar mseekbarforheight;
Button mcalculatebmi;
RelativeLayout mmale,mfemale;
int intweight=55;
int intage=22;
int currentprogress;
String mintprogress="170";
String typerofuser="0";
String weight2="55";
String age2="22";
@SuppressLint("ResourceAsColor")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getSupportActionBar().hide();
mcurrentage=findViewById(R.id.currentage);
P a g e | 19
mcurrentweight=findViewById(R.id.currentweight);
mcurrentheight=findViewById(R.id.currentheight);
mincrementage=findViewById(R.id.incrementage);
mdecrementage=findViewById(R.id.decrementage);
mincrementweight=findViewById(R.id.incremetweight);
mdecrementweight=findViewById(R.id.decrementweight);
mcalculatebmi=findViewById(R.id.calculatebmi);
mseekbarforheight=findViewById(R.id.seekbarforheight);
mmale=findViewById(R.id.male);
mfemale=findViewById(R.id.female);
mmale.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mmale.setBackground(ContextCompat.getDrawable(getApplicationContext(),R.drawable.malefemalefoc
us));
mfemale.setBackground(ContextCompat.getDrawable(getApplicationContext(),R.drawable.malefemalen
otfocus));
typerofuser="Male";
}
});
mfemale.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mfemale.setBackground(ContextCompat.getDrawable(getApplicationContext(),R.drawable.malefemalefo
cus));
mmale.setBackground(ContextCompat.getDrawable(getApplicationContext(),R.drawable.malefemalenot
focus));
typerofuser="Female";
}
});
mseekbarforheight.setMax(300);
mseekbarforheight.setProgress(170);
mseekbarforheight.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
currentprogress=progress;
mintprogress=String.valueOf(currentprogress);
mcurrentheight.setText(mintprogress);
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
P a g e | 20
}
});
mincrementweight.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
intweight=intweight+1;
weight2=String.valueOf(intweight);
mcurrentweight.setText(weight2);
}
});
mincrementage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
intage=intage+1;
age2=String.valueOf(intage);
mcurrentage.setText(age2);
}
});
mdecrementage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
intage=intage-1;
age2=String.valueOf(intage);
mcurrentage.setText(age2);
}
});
mdecrementweight.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
intweight=intweight-1;
weight2=String.valueOf(intweight);
mcurrentweight.setText(weight2);
}
});
mcalculatebmi.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(typerofuser.equals("0"))
{
Toast.makeText(getApplicationContext(),"Select Your Gender
First",Toast.LENGTH_SHORT).show();
}
else if(mintprogress.equals("0"))
{
Toast.makeText(getApplicationContext(),"Select Your Height
First",Toast.LENGTH_SHORT).show();
}
P a g e | 21
}
});
}
}
Mainfest.xml
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.BMICalculator">
<activity android:name=".MainActivity"></activity>
<activity android:name=".bmiactivity" />
<activity android:name=".splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</manifest>
P a g e | 22
OUTPUTS
P a g e | 23
Actual Methodology
Advantages
• As stated, BMI helps measure the obesity rate in people. Observing the
changes in BMI values helps doctors evaluate the obesity levels in people
over time.
• Knowing the BMI value of an individual, doctors can mitigate the health
risks arising due to obesity.
P a g e | 24
Conclusion
References
2)Android Developers
3) YOUTUBE
4)WEBSITES