π± App Overview:
This is a BMI (Body Mass Index) Calculator Android App that supports both Metric and Imperial units. It calculates BMI based on user input (age, gender, height, and weight), displays the result, categorizes it, and provides relevant health tips.
π§ Key Functionalities:
1. Unit Switching (Metric β Imperial):
Toggle between Metric (cm/kg) and Imperial (ft/in/lbs) using a SwitchMaterial.
UI fields update accordingly:
Metric: shows height in cm.
Imperial: shows feet and inches fields.
2. Input Validation:
Validates:
Age (between 2β120)
Weight:
Metric: 2β500 kg
Imperial: 5β1100 lbs
Height:
Metric: 50β300 cm
Imperial: 1β10 ft and 0β11 inches
Displays appropriate error messages if validation fails.
3. BMI Calculation:
Metric formula: BMI = weight (kg) / (height in meters)^2
Imperial formula: BMI = (weight (lbs) Γ 703) / (height in inches)^2
4. BMI Categories:
Based on BMI value:
< 16 β Severe Thinness
16β16.9 β Moderate Thinness
17β18.4 β Mild Thinness
18.5β24.9 β Normal
25β29.9 β Overweight
30β34.9 β Obese Class I
35β39.9 β Obese Class II
40+ β Obese Class III
5. Health Tips:
Each BMI category shows related health advice (e.g., "Eat more nutritious food", "Seek medical help", etc.).
6. Result Display:
Displays:
Calculated BMI
User's Age and Gender
BMI Category
Health Tip