The Body Mass Index (BMI) or Quetelet index is a value derived from the mass weight and height of an individual. The BMI is defined as the body mass divided by the square of the body height, and is universally expressed in units of kg/m². By analyzing the BMI value, we can determine a diagnostic.
- Linear layout (orientation = vertical) used.
- Used EditText views for letting the user enter weight and height values.
- Used a Button view for calculating BMI and changing background color.
- A TextView is displayed on the user interface letting the user know its BMI value.
float bmi = weightValue / (heightValue * heightValue);
. To determine the diagnostic associated to the BMI value, we are going to use the following table :