Estimating User's Weight
- Dominic Ng
- Jan 6, 2019
- 2 min read
Updated: Feb 7, 2019
Hello there! This is the last feature I will be working on before the testing phase of Gastronome’s Android application begins. As this is the main function of the application, my team and I discussed on ways to calculate the user’s estimated weight. Some factors we took into consideration were the age, gender as well as the current weight. With some research online, we found out the ideal number of calories a person should eat based on the gender and age and if the user exceeds the ideal number of calories, the user will gain weight instead of losing weight. We found out that the ideal number of calories for a woman is 12,250 and the ideal number of calories for a man is 15,750. My team and I also researched on the amount of weight one will gain if they exceed the ideal number of calories per week, which is 1g per 8 calories. Even though everyone’s ideal calorie intake a day and the change of weight varies, we used the above numbers as an estimation to predict the user’s weight.
For this feature, I retrieve all the meal in the weekly log of the users for the week and calculate the total calorie intake for the week. I then compare the total calorie intake with the ideal number of calorie and find the difference. Using the difference in calorie intake, I divided it by 8 to get the amount of weight loss/increase after the week and add/subtract it into the user’s current weight which I also had to retrieve from Firebase. Some difficulty I faced when building this feature was the retrieving of which meals to retrieve as all the meals in the logs are grouped under a User ID. Hence, it was tough to retrieve only the meals that are eaten by the user in this week only.
After completing this final feature where the application is able to estimate the user’s weight, Kevin and I will start pushing the application into android phones instead of the Android Studio’s emulator for us and our friends to test for errors, so that we can start to debug before submission. I will be documenting my progress in my blog next week! See you there as the development of Gastronome application is almost coming to an end!



コメント