Ideal Weight - MVC Architecture Mobile App
Purpose:
Software architecture and web data integration are fundamentally important in mobile app design and implementation. This project provides students with the opportunity to put their knowledge of MVC architecture and mobile web integration into practice. Students will develop a simple Ideal Weight calculator application using MVC architecture, then use Web APIs to perform the same Ideal Weight calculation.
Objectives:
Students will be able to:
- ● Apply the MVC architecture to design a mobile app that satisfies given requirements
- ● Implement an MVC architecture-based mobile app
- ● Use Web API calls
- ● Process JSON data in a mobile app
Technology Requirements:
Students may develop an iOS app (preferred) or an Android app. For iOS app:
● XCode 13 or above, programming language Swift (no Objective-C) - strongly preferred For Android app:
● Android SDK using Java
Project Overview:
Phase I [40 Pts]: Design and implement a mobile app that calculates Ideal Weight and displays the results to the user.
Phase II [30 Pts]: Use web API call to calculate BMI and use the API call results to Ideal Weight to the user.
Project Description:
Create an application that, when given the height inches, gender (M or F) and the current weight of a person (as an int value), calculates their Ideal Weight in two ways. In the first phase of this project, you will implement a Ideal Weight calculator of your own based on the guidelines provided. In the second phase, you will use a REST API call to calculate the Ideal Weight once the height inches, gender (M or F) and the current weight are given as parameters to the API.
The main view of your app should have two buttons: "Calculate Ideal Weight " and "Calculate Ideal Weoght using API." Each button leads a user to two different views of the app, which implement phases I and II respectively. The overall user interface of the application should follow the guidelines provided in Figure 1.
Storyboard Design Guidelines for Phases I and II
Note: These design guidelines are based on XCode 10 and developed using swift 4.2. Students using Android SDK can following corresponding design tools available in Android SDK.
Figure 2 shows the storyboard design of the app showing all the views and the file structure required in this application
Submission Directions for Project Deliverables
Submit your Phase I project as a zip file that implements all Phase I requirements. Name your zip file “FirstName_LastName_IdealWeight Calculator Project_Phase_I.zip”.
Submit your Phase II project as a separate zip file that implements all Phase II requirements. Name your zip file “FirstName_LastName_ IdealWeight Calculator Project_Phase_II.zip”.
Phase I:
Ideal Weight Calculator
Your application should be designed and implemented using MVC architecture, View and the View controller handles, and UI display and UI actions. The model should perform the Ideal Weight calculation and provide the results to the View Controller. See Figure 3 for the UI for Phase I.
Design and implement an application that meets the listed criteria:
- ● Reads the height inches, gender (M or F) a person, and the current weight of a person (as an int value)
- ● Calculates the Ideal Weight using following equation
Ideal Weight = 100 + (height(in inches) – 60)*5
Then, displays the following messages to the user based on the Ideal Weight
You are obese if the current weight is 15 pounds more than the Ideal weight - Red Color
Otherwise, You are pre-obese if the current weight is 10 pounds more than the Ideal weight – Purple Color
Otherwise, You are normal if the current weight is + or – 5 pounds of the Ideal Weight- Green Color
If none of the above, You are underweight - Blue Color
Phase II:
Ideal Weight API
Calculate Ideal Weight using a Web API Call. The API should take the height and weight as parameters and return the Ideal Weight, Risk Factor, and Array of web links with health information. Your app should read the height inches, gender (M or F) a person, and the current weight of a person (as an int value) as in Phase I, but call the API to calculate the Ideal Weight. See the example API call in Figure 4 for a height of 72 inches, gender M and current weight of 156 lbs.
Your application should process the JSON results and display Ideal Weight information to the user, as in Phase I. Additionally, when the user selects the button "Educate Me," the app should load a web page that shows additional information about health by using one of the web links from the JSON results.
See Figure 5 for the UI for Phase II.
http://webstrar99.fulton.asu.edu/page2/Service1.svc/IdealWeight?height=72¤tWeight=156&gender=M
The results from the API call is a JSON document structure:
{
"healthInformation":["https:\/\/familydoctor.org\/what-you-can-do-to-maintain-your- health\/","https:\/\/www.livestrong.com\/article\/281134-how-to-calculate- ibw\/","https:\/\/www.populytics.com\/blog\/10-habits-maintain-good-health\/"],
"idealW":178,
"riskFactor":"You are under weight"
}
Figure 4: Example API call for a height of 72 inches and weight of 156 lbs