nur aqilah binti kamaruzamanmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake...

105
FOOD INTAKE FOR DIET MOBILE APPS NUR AQILAH BINTI KAMARUZAMAN BACHELOR OF INFORMATION TECHNOLOGY ( MEDIA INFORMATIC ) HONOURS UNIVERSITY SULTAN ZAINAL ABIDIN 2018

Upload: others

Post on 27-Oct-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

FOOD INTAKE FOR DIET MOBILE APPS

NUR AQILAH BINTI KAMARUZAMAN

BACHELOR OF INFORMATION TECHNOLOGY

( MEDIA INFORMATIC ) HONOURS

UNIVERSITY SULTAN ZAINAL ABIDIN

2018

Page 2: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

FOOD INTAKE FOR DIET MOBILE APPS

NUR AQILAH BINTI KAMARUZAMAN

Bachelor of Information Technology ( Imformatics Media ) Honours

Faculty of Informatic and Computing

Universiti Sultan Zainal Abidin, Terengganu, Malaysia

2018

Page 3: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology
Page 4: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

i

DECLARATION

I hereby declare that this report is based on my original work except for quotations and

citations, which have been duly acknowledged. I also declare that is has not been

previously or concurrently submitted for any other degree at University Sultan Zainal

Abidin or other institutions.

________________________________

Name : Nur Aqilah Binti Kamaruzaman

Date : .....................................................

Page 5: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

ii

CONFIRMATION

This is to confirm that :

The research conducted and the writing of this report was under my supervision.

_____________________________________

Name : Datin Dr. Azim Zaliha Binti Abd Aziz

Date : ................................................................

Page 6: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

iii

DEDICATION

First and for most I would like to express my gratitude to ALLAH S.W.T, which

allowed me to complete this project. Then I would like to sincerely thank to my

supervisor Datin Dr. Azim Zaliha Binti Abd Aziz for the continuous support and

guidance for my project.

Furthermore, I would like to appreciate the panel assessment members for their

continuous guidance, valuable feedback during my project presentation that guide me

to be improve my project and presentation skills.

Next is I want to thanks to my friends who also teach me and help me when developing

this mobile application, which they guide me to fix an error and give me a valuable

idea to improve my project and support.

Lastly, I would like to express my thankful for my parents for their continuous support

to encourage me until finish my project.

Page 7: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

iv

ABSTRACT

Most people are very concerned about what they eat every day. This is because they

tend to find information about what they eat or what is related to diet. But they do not

know how to take the right foods for the diet. Diet is the amount of food needed by

someone, which is a nutrient intake of foods such as protein, carbohydrates, fat,

vitamins, mineral salts, water and salts in the quantities required by their body.

Nowadays, there are many systems that can help people to managing their diet.

However, the system does not focus on user requirements. Some people need nutrition

and dietary requirements vary by weight, age, height and so on. Therefore, we provide

this system to facilitate food intake according to the type of weight, activity level and

so on because every weight requires a different quantity and manner in terms of

exercise. They need something that will help them with the needs of their respective

bodies. The application to be developed is Food Intake For Diet (FIFD). This

application will help and facilitate affairs for people who want to lose weight correctly.

For example, how to eat foods according to the correct quality, the required water

content, and so on. The production of this project for the moment reminds users what

to do and what to do not do. In this system there is a type of diet where consumers can

choose to use the kind of diet they like. Therefore, this application method is

implemented in the system to generate the correct diet plan and health guidelines.

Page 8: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

v

ABSTRAK

Kebanyakan orang sangat mengambil berat tentang apa yang mereka makan setiap

hari. Hal ini adalah kerana mereka cenderung untuk mencari maklumat tentang apa

yang mereka makan atau apa yang berkaitan dengan diet. Tetapi mereka tidak tahu

cara untuk mengambil makanan yang betul untuk diet. Diet ialah jumlah makanan yang

diperlukan oleh seseorng iaitu pengambilan makanan yang mengandungi nutrient

seperti protein, karbohidrat, lemak, vitamin, garam mineral, air dan pelawas dalam

kuantiti yang diperlukan mengikut tubuh mereka. Pada masa kini, terdapat banyak

sistem yang boleh membantu manusia untuk menguruskan diet mereka. Walau

bagaimanapun, sistem tersebut tidak menumpukan kepada keperluan pengguna.

Sesetengah manusia memerlukan nutrisi dan keperluan diet yang berbeza mengikut

berat, umur, ketinggian dan sebagainya. Oleh itu,kami menyediakan sistem ini bagi

memudahkan pengambilan makanan mengikut jenis berat, tahap aktiviti dan

sebagainya kerana setiap berat badan memerlukan kuantiti dan cara yang berbeza dari

segi senaman. Mereka memerlukan sesuatu yang akan membantu mereka dengan

keperluan badan masing-masing. Applikasi yang akan dibangunkan ialah Food Intake

For Diet (FIFD). Applikasi ini akan membantu dan memudahkan urusan bagi orang

yang ingin mengurangkan berat badan secara betul. Sebagai contoh cara pengambilan

makanan mengikut kuntiti yang betul, kadar air yang diperlukan dan sebagainya.

Penghasilan projek ini untuk sentiasan mengingatkan pengguna apa yang perlu diambil

dan apa yang perlu dilakukan. Dalam sistem ini terdapat jenis diet dimana pengguna

boleh memilih untuk menggunakan jenis diet yang mereka suka. Oleh itu, kaedah

applikasi ini dilaksanakan dalam sistem untuk menjana pelan diet dan garis panduan

kesihatan yang betul.

Page 9: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

vi

CONTENTS

PAGE

DECLARATION i

CONFIRMATION ii

DEDICATION iii

ABSTRACT iv

ABSTRAK v

CONTENTS vi

LIST OF TABLES x

LIST OF FIGURES xi

LIST OF ABBREVIATIONS xii

CHAPTER 1 INTRODUCTION

1.0 Introduction 1

1.1 Background Syatem 3

1.2 Problem Statement 4

1.3 Objective 5

1.4 Scopes 5

1. Nutritionist / Admin 5

2. User 5

1.5 Limitation Of Work 6

1.6 Expected Result 6

1.7 Activities And Milestones 7

Page 10: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

vii

1.8 Gantt Chart 8

1.9 Conclusion 9

CHAPTER 2 LITERATURE REVIEW

2.0 Introduction 10

2.1 Application Problems 11

1. ‘My Meal Mate’ (MMM) 11

2. Timing of food intake predicts weight loss

effectiveness

11

3. Dietry Self – Monitoring, Improves with use of

Smartphone apps

12

4. Mobile apps Self – Monitoring of physical activity

and dietary intake among overweight adults

participating in an Health weight loss program.

12

5. Application of a behavioral Approach to

measuring Dietary Change : The Fat and Fiber –

related Diet Behavior Questionnaire

12

Comparison of Existing System 13

2.2 Solution Approach 15

2.2.1 Rule-Based System (RBS) 15

2.3 Conclusion 17

CHAPTER 3 METHODOLOGY

3.0 Introduction 18

1. Analysis 19

Page 11: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

viii

2. Design 20

3. Development 20

4. Implementation 20

5. Evaluation 21

3.1 Problem Identification 22

3.1.1 Framework 22

3.2 Design 24

3.2.1 Process Model 24

3.2.1.1 Context Diagram (CD) 24

3.2.1.2 Data Flow Diagram (DFD) 24

3.2.1.2.1 Data Flow Diagram Level 0 25

3.2.1.2.2 Data Flow Diagram Level 1 28

1. Register 28

2. Manage Food 30

3. Manage Weight / Height 31

4. Manage Exercise 32

3.2.1.3 Activity Diagram 33

3.2.1.4 Sequence Diagram 34

3.2.1.5 Storyboard 35

3.2.1.6 Prototype 37

3.2.2 Data Model 40

3.2.2.1 Entity Relationship Diagram (ERD) 40

3.2.2.2 System Requirement 42

1. Software 42

2. Hardware 42

Page 12: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

ix

3.3 Conclusion 43

CHAPTER 4 IMPLEMENTATION RESULT

4.0 Introduction 44

4.1 Test Result (Interface) 44

4.1.1 User Module 44

4.1.1.1 Start Page 45

4.1.1.2 Login / Sign Up Page 45

4.1.1.3 Choose Diet Page 46

4.1.1.4 Choose Gender 46

4.1.1.5 Sign Up (User Information) 47

4.1.1.6 Login Page 47

4.1.1.7 Home Page 48

1. Home (Update Weight and Height) 48

4.1.1.8 Plan Page 49

4.1.1.9 Add Page 49

4.1.1.10 Add (Reminder) 50

1. Reminder (List Add) 50

2. Reminder (Choose To Create Reminder) 50

4.1.1.11 Exercise Page 51

1. Exercise (Cross Jack) 51

2. Exercise (Wall Plank Leg Lift) 52

3. Exercise (Wall Plank Arm Lift) 52

4. Exercise (Full Plank) 53

5. Exercise (Plank) 53

Page 13: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

x

6. Exercise (Bicycle Kick) 54

7. Exercise (Knee Grab Sit-Up) 54

8. Exercise (V-Sit) 55

9. Exercise (Anterior Shoulder Stretch) 55

10. Exercise (Cobra Pose) 56

11. Exercise (Start All) 56

4.1.1.12 Me Page (Show User Information) 57

4.2 Conclusion 58

CHAPTER 5 TESTING AND RESULT

5.0 Introduction 59

5.1 Test Cases 60

5.1.1 User Module 60

5.2 Conclusion 67

CHAPTER 6 DISCUSSION AND CONCLUSION

6.0 Introduction 68

6.1 Project Contribution 69

6.2 Project Contribution and Limitation 69

6.3 Future Work 70

6.4 Conclusion 70

REFERENCES 71

Page 14: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

xi

LIST OF TABLES

TABLE TITLE PAGE

1.1 Gantt Chart 8

2.1 Comparison Of Existing System 13

2.2 Example Coding Using Rule-Based System 16

5.1 Test Cases For User Registration (Sign Up) 60

5.2 Test Cases For User Login 62

5.3 Test Cases For User Update Weight and Height 63

5.4 Test Cases For User Update Menu

(Breakfast, Lunch, Dinner)

64

5.5 Test Cases For User Update Profile 65

5.6 Test Cases For User Notification (Reminder) 65

5.7 Test Cases For User Logout 66

Page 15: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

xii

LIST OF FIGURES

FIGURE TITLE PAGE

1.1 Activities And Milestones 7

3.1 ADDIE Method 19

3.2 Framework 22

3.3 Context Diagram 24

3.4 Data Flow Diagram Level 0 24

3.5 Register DFD Level 1 28

3.6 Manage Food DFD Level 1 30

3.7 Manage Weight/ Height DFD Level 1 31

3.8 Manage Exercise DFD Level 1 32

3.9 Activity Diagram 33

3.10 Sequence Diagram 34

3.11 Storyboard 35

3.12 Prototype 37

3.13 Entity Relationship Diagram (ERD) 40

4.1 Start Page (First Page) 45

4.2 Login and Sign Up Page 45

4.3 Choose Diet Page 46

4.4 Choose Gender 46

4.5 Sign Up (User Information) 47

4.6 Login Page 47

4.7 Home Page 48

Page 16: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

xiii

4.8 Home (Update Weight and Height) 48

4.9 Plan Page 49

4.10 Add Page 49

4.11 List Add Reminder Page 50

4.12 Choose To Create Reminder Page 50

4.13 Exercise Page 51

4.14 Exercise Cross Jack 51

4.15 Exercise Wall Plank Leg Lift 52

4.16 Exercise Wall Plank Arm Lift 52

4.17 Exercise Full Plank 53

4.18 Exercise Plank 53

4.19 Exercise Exercise Bicycle Kick 54

4.20 Exercise Knee Grab Sit-Up 54

4.21 Exercise V-Sit 55

4.22 Exercise Anterior Shoulder Stretch 55

4.23 Exercise Cobra Pose 56

4.24 All Exercise 56

4.25 Me Page (User Information) 57

Page 17: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

xiv

LIST OF ABBREVIATIONS / TERMS / SYMBOLS

FYP Final Year Project

UniSZA Universiti Sultan Zainal Abidin

FIFD Food Intake For Diet

APPS Application

BMI Body Mass Index

PHP Hypertext Pre-Processor

HTML Hyper Text Mark-up Language

SQL Structured Query Language

2D Two Dimentional

3D Three Dimentional

RBS Rule-Based System

CD Context Diagram

DFD Data Flow Diagram

ERD Entity Relationship Diagram

Page 18: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

xv

LIST OF APPENDICES

APPENDIX TITLE PAGE

A Appendix 1 73

Gantt Chart (Final Year I) 73

Gantt Chart (Final Year II) 74

B Appendix 2 75

Page 19: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

1

CHAPTER 1

INTRODUCTION

1.0 Introduction

People at this time are very concerned about their health and nutrition. Most of

them are dieting, but are not good at choosing the right nutrition. A healthy diet is

a healthy eating habits. A good diet is a balanced diet that meets all the needs of

the body, such as foods that contain nutrients such as proteins, carbohydrates, fats,

vitamins, mineral salts, water and salts in the quantities required. Malaysia is one

of the countries that have dietary issues because they have a lot of obesity.

Malaysia is the first of ASEAN and sixth in the Asia-Pacific region.

Page 20: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

2

Diet is an important part of our daily lives. Applying a diet can mean making some

good choices about nutrition (eating more fruits, vegetables, and fiber) or bad

choices (skipping food, eating too little or not eating enough food). Diet is the

amount of food used by a person in a certain amount. Diet often implies the use of

specific nutrition for health or the reason for weight management. A specific diet

can be selected for weight loss or weight gain. Some foods are specifically

recommended or altered for compliance with pertinent dietary requirements. Diet

also has many different types, namely the first Paleo diet. The paleo diet is a diet

with no rice, processed foods, sugars, dairy and cereals. Second, diet atkins is a

diet that only consumes foods containing protein and fat, and avoids foods

containing carbohydrates. Third, a vegetarian diet is a diet that only eat fruits and

vegetables only at the right rate. Fourth, raw food diet ie food and beverages not

processed or cooked ie based on plants and organic matter.

The diet should also follow the proper syllabus because different people will have

different dietary nutrition requirements based on their weight, age, height, gender

and daily activity. For example, having two dieters using atkins diet and weighing

weight, people weighing 60 and weighing 140, the system will set the appropriate

rates and quantities according to their weight. Therefore, we recommend this

system to help those who want to diet in the right way.

Page 21: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

3

1.1. Background System

Food Intake For Diet (FIFD) is an application system. It is responsible for

developing a diet plan and dietary health guidelines for people who want to lose

weight using the right method. FIFD has worked together to help people who

want to lose weight reduce the number of obesity in Malaysia.

FIFD is a system that can help users to manage their daily diet or food intake

appropriate for their body needs according to proper syllabus. This system is one

of the effective alternatives to reducing heavy lose and changing lifestyles that

benefit the public in various ways. Diet menu plans are generated based on the

user's health state, which is the level of dietary level, and body mass index (BMI).

Consumers will choose which diet they want to use. For example, using the Atkins

diet method. Therefore, it will help the user to take what kind of food dishes are

appropriate for them and always remind the user. It is easier for users to plan their

daily diet better.

This system is developed using PHP and HTML for web development and

MySQL as a database platform and we use Flash, 2D and 3D to increase

animation. This system is based on rules for producing diet plans and dietary

guidelines for Diet.

Page 22: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

4

1.2. Problem Statement

People at this time are very concerned about their health but they are unaware that

good food intake will provide good health. They are less concerned about what

they eat. However, there are some problems, most of whom are less aware of how

to choose and the type of food that is suitable for their body. This is because

different people will have different dietary requirements. For example, some

people like to use the vegetarian diet because he only wants to eat vegetables and

fruits and think because by eating vegetables it can lose weight quickly. The

amount of food intake should be according to the weight and the body needs to

have enough protein for the body. The right way to take food should also look at

the type of age, weight, height, gender and lifestyle first.

In this modern age, people live in a busy and always on the go. So, some of them

do not have time to make details about what they need to eat. They only eat

without knowing what is actually right for their body and most of them use drugs

to help them lose weight quickly without knowing the effects of the future. And

lastly, many people who want to diet but lose their appetite. Some people, can not

withstand the desire but want to be skinny and because there are some who use

skin peels.

Therefore, we build this system to help those who want to lose weight using food

intake in the right way.

Page 23: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

5

1.3. Objectives

Food Objective For Diet Applications is:

- To plan a food intake apps for people who want to lose weight correctly

- To develop an apps that can help reduce the number of obesity in Malaysia

- To implement rule-based rules in Food Acquisition for Diet

1.4. Scopes

The main scope for the apps is:

1. Nutritionist / Admin

Admin has the power to manage, update and delete diet menu data and health

guidelines in the apps

2. User

Users can sign up and login to the apps and perform tasks that are set in the

apps. Users can manage profiles, manage the latest information such as weight

loss, manage health conditions with take through of body, and exercise. Users

can access the system anytime and anywhere. And all user can use this apps

it’s general for all user.

Page 24: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

6

1.5. Limitation Of Work

Food Diet for Diet (FIFD) provides dietary recommendations and health

guidelines based on dietary phases, body mass index (BMI) and appropriate level

of activity using android user only. It is designed to help them with diet using the

right foods for those who want to lose weight only. Design for the diet is also

suitable for people who follow the diet. Diet planner consists of a recommended

diet based on the type of diet and health guidelines that are suitable for those who

need to lose weight but user that making decision that cannot be determined.

1.6. Expected Result

- Rules based rules can be implemented on the apps

- The relationship between food, activity and carbohydrate intake can be

identified

- An apps that can help and benefit the users in their diet

Page 25: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

7

1.7. Activities and Milestones

ACTIVITIES MILESTONES

Month 9/18 10/18 11/18 12/18 2/19 3/19 4/19 5/19

Strategy

Analysis

Planning

Design

Apps Develop

Testing

Develop

Support

Figure 1.1 Activities and Milestones

Page 26: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

8

1.8. Gantt Chart

Table 1.1 show Gantt Chart

Week

Activity

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Topic discussion and

determination

Project Title proposal

Proposal writing Introduction

Proposal writing Literature

Review

Proposal progress

presentation & evaluation

Discussion correction

proposal & proposed solution

methodology

Proposal solution

Methodology

Proposal solution &

methodology (continue)

Proof of concept

Drafting report of the

proposal

Submit draft of report to

supervisior

Siminar presentation (final)

Correction report

Final report submission

Page 27: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

9

1.9. Conclusion

The apps is designed to help those who want to lose weight with proper dietary

intake - nutrition - containing foods such as protein, carbohydrates, fats, vitamins,

mineral salts, water and salts in the quantities required. And it's also important to

remind consumers to take the correct dietary content.

In turn, the system is designed to help control obesity rates. The apps is also set

up to balance the intake of food with physical activity and make the physical body

better. And besides it works for a diet, the system also works for the right exercise.

Page 28: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

10

CHAPTER 2

LITERATURE REVIEW

2.0 Introduction

In the literature review we will discuss fulture about Food Intake For Diet mobile

application that contains the definition and previous research of application

problem that comparison of existing system and we will find the solution approach

that apps use.

Page 29: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

11

2.1 Application Problem

Application problem in this topic is explain about comparison with another apps

or system that already have and find the weakness to solving the problem while

creating these apps. There are five already existing system information :

1. ‘My Meal Mate’ (MMM)

The purpose of this study was to assess the self-monitoring about dietary and

physical activity.

Strength – The extensive database with generic and branded food items for

people to choose from

Weakness – Must using internet, unattractive design, not understand the button

use

2. Timing of food intake predicts weight loss effectiveness

Timing of food intake influences the success of a weight-loss diet in humans

and to evaluate the role of food timing in weight-loss effectiveness.

Strength – the sample is relative large with numerous exposure variables

including biomarkers and genetic indicators

Weakness - Unattractive design, easily bored, lots of text

Page 30: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

12

3. Dietry Self – Monitoring, Improves with use of Smartphone apps

Dietary self-monitoring is linked to improved weight loss success using

smartphone applications (apps) that allow to improved dietary tracking

adherence.

Strength – Smartphones apps, interesting design

Weakness – Graphics, using inappropriate threads

4. Mobile apps Self – Monitoring of physical activity and dietary intake

among overweight adults participating in an Health weight loss program.

Assess the self-monitoring about dietary and physical activity that monitoring

related to changes in self-monitoring frequency, dietary outcomes, energy

expenditure, body mass index (BMI), and body weight.

Strength – Use of validated measures and weekly data collected on both self-

monitoring and adherence to the intervention

Weakness - Lack of information, product quality not top-notch

5. Application of a behavioral Approach to measuring Dietary Change : The

Fat and Fiber – related Diet Behavior Questionnaire

This apps use to provide insight into the process of practicing a healthy diet

with regard to fat and fiber.

Strength - User friendly interface

Weakness - Using lesser colors, lack of information

Page 31: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

13

Comparison of Existing System

TITLE AUTHOR ABOUT STRENGTH WEAKNESS

‘My Meal

Mate’

(MMM)

- Michelle C.

Carter

- V. J. Burley

The present study

aimed to validate the

diet measures

recorded on MMM

against a reference

measure of 24 h

dietary recall

- Easy to

navigate

- Easy to

understand

- Poor mobile

optimization

- Unattractive

design

Timing of

food intake

predicts

weight loss

effectiveness

- M Garaulet

- P Gomez-

Abellan

- JJ

Alburquerq

ue-Bejar

To evaluate the role of

food timing in weight-

loss effectiveness

- Easy to

understand

- Creative

idea

- Unattractive

design

- Easily bored

- Lots of text

Dietary Self-

Monitoring,

Improves

With Use of

Smartphone

App

- Christoper

M. Wharton

- Carol S.

Johnston

Dietary self-

monitoring is linked

to weight loss

success. Smartphone

applications (apps)

that allow for

improved dietary

tracking adherence.

- Interesting

design

- Clarity of

instruction

- Graphics

- Using

inappropriate

threads

Mobile app

self-

monitoring of

- Gabriella M

Turner-

McGrievy

The purpose of this

study was to assess

the self-monitoring

- Easy to

understand

- Lack of

information

Page 32: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

14

physical

activity and

dietary

intake among

overweight

adults

participating

in an Health

weight loss

program

- Michael W

Beets

- Justin B

Moore

- Andrew T

Kaczynski

about dietary and

physical activity

- User

friendly

- product

quality not

top-notch

Application

of a

Behavioral

Approach to

Measuring

Dietary

Change:

The Fat- and

Fiber-related

Diet

Behavior

Questionnair

e

- Jackilen

Shannon

- Alan R.

Kristal

- Susan J.

Curry

- Shirley A.

A.

Beresford

To provide insight

into the process of

practicing a healthy

diet with regard to fat

and fiber

- User

friendly

interface

- using lesser

colors

Table 2.1 Show the comparison of Existing System

Page 33: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

15

2.2 Solution Approach

The solution approach describes the general approach that will be taken to create

or acquire the new capabilities required the need. To determine the solution

approach, it is necessary to identify possible approaches, determine the means by

which the solution may be delivered (including the methodology and lifecycle to

be used) and assess whether is capable of implementing and effectively using a

solution. Then the tecnique that we use is Rule-based system (RBS) to remind the

user.

2.2.1 Rule-Based System (RBS)

In computer science, a rule-based system is a set of "if-then" statements that

uses a set of assertions, to which rules on how to act upon those assertions

are created. In software development, rule-based systems can be used to

create software that will provide an answer to a problem in place of a human

expert. These type of system may also be called an expert system. Rule-based

systems are also used in AI (artificial intelligence)programming and systems.

Rule-based system are used to store and manipulate knowledge to interpret

information in a useful way. rule-based system is also known as expert

system and consist of rule base, inference engine, working memory and user

interface as well as a set of if-then statement and rule set containing encoded

knowledge of an expert.

Page 34: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

16

Example of coding :

c = Clock ;

Rule 1 :

if (c ”07:30”) {

then “Food Intake For Diet.

Good Morning :) Your Breakfast is waiting … "; }

Rule 2 :

else if (c ”13:00”) {

then “Food Intake For Diet.

Good Evening :) Your Lunch is waiting … "; }

Rule 3 :

else if (c “20:00”) {

then “Food Intake For Diet.

Good Night :) Your Dinner is waiting … "; }

Table 2.2 Show the example coding using Rule-based system for remainder

Page 35: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

17

2.3 Conclusion

As the conclusion, there are few research thesis that already been discussed about

system and mobile application that will help more with this project. There are also

application that is more advance but not specific enough for whom are want to loss

weight and diet.

It is easy to apply and fast to read the data. Than we using technique rule-based

system that applied to making this project to popup or remainder to user.

Page 36: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

18

CHAPTER 3

METHODOLOGY

3.0 Introduction

In these chapter, we will describe the methodology concept in system

development. We will explain step by step on developing the systems and how to

develop it. For the Food Intake for Diet, it will be following by step that has been

designed from start until finish and we using ADDIE method.

Addie is an acronym for the five stages of a development process that stand from

Analysis, Design, Development, Implementation, and Evaluation. The ADDIE

model relies on each stage being done in the given order but with a focus on

Page 37: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

19

reflection and iteration. The model gives a streamlined, focused approach that

provides feedback for continuous improvement.

Figure 3.1 ADDIE method

1. Analysis

Analysis is a detailed examination of anything complex in order to understand

its nature or to determine its essential features from a thorough study. Before start

developing any content or training strategies, we must analyze the current

situation in terms of training, knowledge gaps and etc. First, start with questions

to understand the current situation and to also understand what is the goal.One

very common question is: What is problem statement? find problem that they

have and face. Then develop the apps to solve problems and adds the advantages

of the function to be better and more attractive. Then find Software and hardware

requirement used to develop the apps

Page 38: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

20

2. Design

Design is to create, execute, or construct according to plan (designing and

contrive). With training plan, it is need us to design phase – this is where we take

all of the learnings of the previous phase and use it to make practical decisions.

This includes a strategy, delivery methods, structure, duration, assessment, and

feedback. Then it is to do storyboard ideas and create a prototype like process

design and Interface design for user and admin

3. Development

Development is the act, process, or result of developing after designing the

prototype. Each element of the course should be developed to match the design

phase. To develop the apps we must know how to use script ( java script, php,

html) and which script that we use. Then it must have the element of multimedia

like animation and multimedia component like audio, video, picture and etc.The

development process should be iterative. Once you have created a course you

should test it to ensure there are no basic errors – grammar, spelling, syntax etc.

Testing should also look at the mechanics of the course.

4. Implementation

Implementation is an act or instance of implementing something like the process

of making something active or effective. Once you have completed and you are

satisfied that are fully tested, it’s time to deploy prototype apps to the general

public that this apps exist.The decisions made in the design phase will influence

how this is actually carried out.

Page 39: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

21

5. Evaluation

Evaluation is the act or result of evaluating. Getting feedback on every aspect

like test functionalities of developing prototype apps is really important so that

can improve and revise the content. A great way to get feedback is to ask

someone to complete surveys at the end of their course. Create questions specific

to the points above but, also encourage people to give feedback in a free text box

so that you are aware of any gaps you may not have thought of.

Page 40: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

22

3.1 Problem Identification

Problem identification is to provide the platform for investigating a broad range of

intervention and generating option. Initiative develop in subsequent step of the

Framework should address the problem identified.

3.1.1 Framework

Figure 3.2 Framework

Page 41: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

23

According to the framework in Figure 3.2, first nutritionist will login into the

system then nutritionist can manage the Food Intake Apps to insert the

information and generate report. Nutritionist is responsible to update and delete

the information. Second, user need to register first before login into apps to able

to manage their food, informatin and weight when they need tu update. Then all

the information will be store in database.

Page 42: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

24

3.2 Design

3.2.1 Process Model

3.2.1.1 Context Diagram

Figure 3.3 Context Diagram of the applicatin

Figure 3.3 show of context diagram in Food Intake For Diet. There are two main

users in this systems which consist of user and nutritionist or admin. This

diagram show the flow for in and out from the data which is used by the user

and nutritionist itself, in the early stage where user can register and login to

access into the system and to used them.

3.2.1.2 Data Flow Diagram (DFD)

In the Data Flow Diagram (DFD), it will explain on how the data is inserted and

sent into the system to be processed and stored. Data flow diagram is also a two-

dimensional diagram that consists of entities, processes and files to show the

flow of the data in this system.

Page 43: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

25

3.2.1.2.1 Data Flow Diagram Level 0

Figure 3.4 Data Flow Diagram Level 0 of the application

Based on the Figure 3.4 above, DFD shows the process that has been done

which consist of two entities i.e. user and nutritionist (admin). The proses of

the system are register, login, manage food intake, manage weight, exercise

and generate report.

Page 44: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

26

Process 1.0 : Register

In register process, new users are required to register and fill in the

information in order to open a new account and the information will be

stored and to be insert into user files in the systems.

Process 2.0 : Login

In login process, user and nutritionist (admin) are required to log into the

system to access using username and paswword. And then the system will

verify the username and password that given from user and nutritionist file.

Process 3.0 : Manage Food Intake

In manage food intake process, nutritionist will manage including add,

update and delete the meals information from food intake file and it will be

save and stored in database if we change the information. The user can add

and delete the meals if the recommended food cannot be eaten by users, so

that it will remind the users what food they need to take.

Process 4.0 : Manage Weight

In manage weight process, user can manage and update their weight if there

is any changes on their weight and to see whether the diet process is effective

or not. Then the information change by the user will be save and stored in

the database.

Page 45: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

27

Process 5.0 : Exercise

In exercise process, user can follow the suggestion provided to do exercise

by following the steps guided in order to speed up the process for losing

body weight. It also provide the guide step on how to do the exercise.

Process 6.0 : Generate Report

In generate report process, nutritionist can generate report from all files for

record and user can generate and get the report with monthly or weekly

report of their success loss weight following the period taken to be success

in losing weight. Then all the information will be obtained from the

database.

Page 46: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

28

3.2.1.2.2 Data Flow Diagram Level 1

Data Flow Diagram Level 1 show the processes in DFD Level 0. There are

DFD Level 1 that will be explain is register, manage food intake, manage

weight and manage exercise. From there, it will be divide and described

according to the process.

1. Register

Figure 3.5 DFD Level 1 of Register process

Page 47: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

29

In the process of Register as in Figure 3.5, user can register and required

to enter their personal information like (name, age, gender and email),

insert their weight, and insert username and password. Then user can

submit their data and data will be store in database and system will

display the details to user.

Page 48: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

30

2. Manage Food

Figure 3.6 DFD Level 1 of Manage Food process

In the process of Manage Food as in Figure 3.6, nutritionist will add the

diet plan into the database and nutritionist can edit and delete the details.

The user also can add their meals and delete back if they won’t eat it. And

all information that change will be update and save in the database and

display in intercafe.

Page 49: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

31

3. Manage Weight/ Height

Figure 3.7 DFD Level 1 of Manage Weight/Height process

In the process of Manage Weight as in Figure 3.7, user can manage their

weight by updating or change their weight if they loss weight and submit

the change into database. Than it will display them in user interface.

Page 50: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

32

4. Manage Exercise

Figure 3.8 DFD Level 1 of Manage Exercise process

In the process of Manage Exercise as in Figure 3.8, the nutritionist will

add the exercise detail information in database. Then the nutritionist can

edit the detail and also can delete if not needed and submit the detail to

save into database. And lastly all changes will be display in interface.

Page 51: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

33

3.2.1.3 Activity Diagram

Figure 3.9 Activity Diagram of application

In the Activity Diagram as in Figure 3.9, activity diagram are graphical

representation of workflow of stepwise activities and actions with support for

choice, iteration and concurrency.

Page 52: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

34

3.2.1.4 Sequence Diagram

Figure 3.10 Sequence Diagram of application

In the Sequence Diagram as in Figure 3.10 are show a parallel vertical lines

which displays step-by-step data that comes in and out in the system.

Page 53: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

35

3.2.1.5 Storyboard

A storyboard is a sequence of drawings, typically with some directions and

dialogue, representing the shots planned for someting like filemn or create the

system or apps. A storyboard is a graphic representation of how your apps will

unfold, step by step and etc.It’s made up of a number of squares with

illustrations or pictures representing each step,and what’s function that have in

the script. Think of it as sort of a comic book version of your script. this is my

storyboard of Food Intake for Diet mobile app.

Page 54: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

36

Figure 3.11 show storyboard of Food Intake for Diet mobile app

Page 55: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

37

3.2.1.6 Prototype

A prototype is an early sample, model, or release of a product built to test a

concept or process or to act as a thing to be replicated or learned from. It is a

term used in a variety of contexts, including semantics, design, electronics, and

software programming. This is prototypy from Food Intake for Diet mobile

apps that will develop soon. And we show you step by step to using this apps.

Page 56: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

38

Page 57: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

39

Figure 3.12 show prototype of Food Intake for Diet mobile app

Page 58: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

40

3.2.2 Data Model

3.2.2.1 Entity Relationship Diagram (ERD)

Figure 3.13 Entity Relationship Diagram of application

Page 59: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

41

The entity relationship diagram as in the Figure 3.13 are showing the

relationship between each entity that have in the system and each entity have

their attribute that support the entity. Based on the Food Intake For Diet, the

entity that have in diagram is User, Nutritionist (admin), Weight, Exercise and

Food Intake.

In the user entity it contains with user id as primary key, name, weight gender

and email. The user are required to input the information or detail about

themselves and the data will be save in database. The nutritionist entity is

contain with username and password. While in the weight entity contains with

user id as foreign key, weight id as primary key and height. Exercise attribute is

contains with exercise id as primary key, exercise name, and exercise note. And

for food intake attribute is user id as foreign key, food id as primary key, food

name, food group and food note.

Page 60: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

42

3.2.2.2 System Requirement

In order to develop the application, the uses of software and hadware are

important. Thare are the list name of software and hardware that used to

develop the proposed application.

1. Software

i. Microsoft Office 2013

ii. Microsoft PowerPoint 2013

iii. Google Chrome

iv. Adobe Photoshop CS6

v. Adobe Plash

vi. Android Studio

vii. Proto.io

viii. Xampp

2. Hardware

i. Laptop

ii. Pendrive

iii. Android Phone

iv. Printer

Page 61: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

43

3.3 Conclusion

To conclude overall, from this chapter it explained about the modeling and design

of the mobile application. Furthermore it shows that a good designed database

gives us to access the information. This is why at the end of the app;ication it will

meet the database that is importance for applications.

Page 62: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

44

CHAPTER 4

IMPLEMENTATION AND RESULT

4.0 Introduction

In these chapter, we will describe about implementation in the construction of the

application and the delivery of it into production. Interface user of the application

are include in this chapter.

4.1 Test Result (Interface)

4.1.1 User Modul

Page 63: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

45

4.1.1.1 Start Page

Figure 4.1 Start Page (First Page)

Figure 4.1 show the start page interface of the application. The application

show that the new user need to press start first before enter to the new page

where user can choose to login or signup.

4.1.1.2 Login / Sign Up Page

Figure 4.2 Login and Signup Page

Figure 4.2 show the login and signup page of the application. This page,

needed the new user (he/she) must signup to register the account and for the

already user they can just login to their account.

Page 64: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

46

4.1.1.3 Choose Diet Page

Figure 4.3 Choose Diet Page

Figure 4.3 show the choose diet page for the application. This page show to

the new user where they have to choose what kind of diet they want to apply.

For example the user choose Paleo diet.

4.1.1.4 Choose Gender

Figure 4.4 Choose Gender Page

Figure 4.4 show the choose gender page for the application. This page show to

that the new user need to choose their gender.

Page 65: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

47

4.1.1.5 Sign Up (User Information)

Figure 4.5 Sign Up (User Information)

Figure 4.5 show the signup page for the application. This page show for the

new user to fill in their information to register before login. User compulsory

need to enter their name, password, email, age, height, weight, and goal

weight.

4.1.1.6 Login Page

Figure 4.6 Login Page

Figure 4.6 show the login page of the application. This is the page where the

user that already register and have account can login to the application. User

must entering their name and password to login the account.

Page 66: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

48

4.1.1.7 Home Page

Figure 4.7 Home Page

Figure 4.7 show the home page of the application. This page show to user about

water, information about water and update weight and height. For the

checkbox, after user drink 250 ml water they can tick the button to save their

information. (1 box = 250 ml water)

1. Home (Update Weight/Height)

Figure 4.8 Update Weight and Height Page

Figure 4.8 show the update weight and height page of the application. The user

can update their weight and height every one week.

Page 67: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

49

4.1.1.8 Plan Page

Figure 4.9 Plan Page

Figure 4.9 show the plan page of the application. This pages show where the

user can use the reminder to take their food if only user set their plan as

reminder. After user take their food user can tick to save the data.

4.1.1.9 Add Page

Figure 4.10 Add Page

Figure 4.10 show the add page of the application. This pages show that the

user can change their menu on breakfast, lunch or dinner. They also can set the

reminder on these page.

Page 68: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

50

4.1.1.10 Add (Reminder)

1. Reminder (List that we add)

Figure 4.11 List Add Reminder Page

Figure 4.11 show the add reminder page of the application. This pages show

the user can add reminder to remind their time to take the food.

2. Reminder (choose to create reminder)

Figure 4.12 Choose to Create Reminder Page

Figure 4.12 show the choose to create reminder page of the application. This

pages show the user to set the reminder using insert the time and choose the

days.

Page 69: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

51

4.1.1.11 Exercise Page

Figure 4.13 Exercise Page

Figure 4.13 show the exercise page of the application. This pages show some

basic exercise that is good and can be use for those who was taking diet.

1. Exercise (Cross Jack)

Figure 4.14 Exercise Cross Jack Page

Figure 4.14 show the exercise cross jack page of the application. This pages

show the video about the exercise and the information guide step-by-step on

how to do that exercise.

Page 70: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

52

2. Exercise (Wall Plank Leg Lift)

Figure 4.15 Exercise Wall Plank Leg Lift Page

Figure 4.15 show the exercise wall plank leg lift page of the application. This

pages show the video about the exercise and the information guide step-by-

step on how to do that exercise.

3. Exercise (Wall Plank Arm Lift)

Figure 4.16 Exercise Wall Plank Arm Lift Page

Figure 4.16 show the exercise wall plank arm lift page of the application. This

pages show the video about the exercise and the information guiding step-by-

step on how to do that exercise.

Page 71: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

53

4. Exercise (Full Plank)

Figure 4.17 Exercise Full Plank Page

Figure 4.17 show the exercise full plank page of the application. This pages

show the video about the exercise and the information guide step-by-step on

how to do that exercise.

5. Exercise (Plank)

Figure 4.18 Exercise Plank Page

Figure 4.18 show the exercise plank page of the application. This pages show

the video about the exercise and the information guide step-by-step on how to

do that exercise.

Page 72: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

54

6. Exercise (Bicycle Kick)

Figure 4.19 Exercise Bicycle Kick Page

Figure 4.19 show the exercise bicycle kick page of the application. This pages

show the video about the exercise and the information guide step-by-step on

how to do that exercise.

7. Exercise (Knee Grab Sit Up)

Figure 4.20 Exercise Knee Grab Sit Up Page

Figure 4.20 show the exercise knee grab sit up page of the application. This

pages show the video about the exercise and the information guide step-by-

step on how to do that exercise.

Page 73: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

55

8. Exercise (V-Sit)

Figure 4.21 Exercise V-Sit Page

Figure 4.21 show the exercise v-sit page of the application. This pages show

the video about the exercise and the information guide step-by-step on how to

do that exercise.

9. Exercise (Anterior Shoulder Stretch)

Figure 4.22 Exercise Anterior Shoulder Stretch Page

Figure 4.22 show the exercise anterior shoulder stretch page of the application.

This pages show the video about the exercise and the information guide step-

by-step on how to do that exercise.

Page 74: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

56

10. Exercise (Cobra Pose)

Figure 4.23 Exercise Cobra Pose Page

Figure 4.23 show the exercise cobra pose page of the application. This pages

show the video about the exercise and the information guide step-by-step on

how to do that exercise.

11. Exercise (Start All)

Figure 4.24 All Exercise Page

Figure 4.24 show the all exercise page of the application. This pages show the

video about all the exercise if any user want to follow all the exercise provided.

(1 exercise = 30 second)

Page 75: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

57

4.1.1.12 Me Page (Show User Information)

Figure 4.25 Me Page

Figure 4.25 show the “me” page of the application. This pages shows the user

about their information like name, email, age, height, weight, goal weight and

also user Body Mass Index (BMI). The BMI is already calculate even when

user update their weight.

Page 76: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

58

4.2 Conclusion

The conclusion, in this chapter, we have shown all of the page of our application

that user can be seen and used for an easily application to help their problems. We

also show the guide step-by-step to enter this application page and used it

functionality.

Page 77: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

59

CHAPTER 5

TESTING AND RESULT

5.0 Introduction

In these chapter, we will describe about testing that executed to encure the Food

Intake For Diet that is develop according to the requirements and achieved it’s

objectives. Test cases that we are already test are included in this chapter.

Page 78: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

60

5.1 Test Cases

In test cases, input, action, event or unexpected response of the application will be

described in this chapter. The tables wil show the test cases for the processes

happened in the application that we do.

5.1.1 User Module

Table 5.1 Test Cases for User Registration (Sign Up)

Test Cases for User Registration (Sign Up)

Step Test Procedure Expected Result Result

1. User clicks button

“Sign Up” from

login/sign up page

Display page of diet type Success

2. User choose type of

diet that user want

Display page of gender Success

3. User choose type of

gender

Display registration form Success

4. User fill in the

required

information in the

registration form

5. User clicks button

“Next”

Validation : Success

Page 79: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

61

If there is empty form, system

display “Please insert all

information correctly”

Else :

Data saved into database and go

to login page

Success

Page 80: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

62

Table 5.2 Test Cases for User Login

Test Cases for User Login

Step Test Procedure Expected Result Result

1. User clicks button

“Login” from

login/sign up page

Display login page which

consists of username and

password

Success

2. User insert

username and

password

3. User clicks

button“Login”

Validation :

If user enter wrong username and

password or empty form, system

display “Please enter the right

input”

Success

Else :

If user enter the right input,

system display “You are now

successfull” and enter into home

page

Success

Page 81: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

63

Table 5.3 Test Cases for User Update Weight and Height

Test Cases for User Update Weight and Height

Step Test Procedure Expected Result Result

1. User clicks button

“Update weight and

height” from home

page

Display update weight and height

page

Success

2. User insert weight

and height

3. User clicks button

“Save”

Validation :

If user enter empty form, system

display “Please enter the input”

Success

Else :

If user enter the right input,

system display “Your data have

been saved” and go back to home

page

Success

Page 82: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

64

Table 5.4 Test Cases for User Update Menu (Breakfast, Lunch, Dinner)

Test Cases for User Update Menu (Breakfast, Lunch, Dinner)

Step Test Procedure Expected Result Result

1. User clicks button

“Breakfast” from

add page

Display breakfast page Success

2. User choose water,

food and dessert

3. User clicks button

“Save”

Validation :

If user leave the empty choosed,

system display “Please select all

of them”

Else :

If user choose all, system display

“Your data have been save” and

go back to add page

Page 83: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

65

Table 5.5 Test Cases for User Update Profile

Test Cases for User Update Profile

Step Test Procedure Expected Result Result

1. User clicks at the

image from “me”

page

Display a file to choose an image Success

2. User change image Validation :

If user choose the image and

clicks “Open”

Display the new image

Success

3. Else :

If user click “Cancle”

Display the blank image

Success

Table 5.6 Test Cases for User Notification (Reminder)

Test Cases for User Notification (Reminder)

Step Test Procedure Expected Result Result

1. User clicks button

“Reminder”

Display reminder page Success

2. User click button

“+ ”

Display another page to choose

the time, label and days

Success

3. User insert the

information

4. User clicks button

“Save”

Notification will show when time

is coming

Success

Page 84: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

66

Table 5.7 Test Cases for User Logout

Test Cases for User Logout

Step Test Procedure Expected Result Result

1. User sign up Display sign up form (insert

information)

Success

2. User login Display user home page Success

3. User go to “me”

page

4. User clicks button

“Logout”

System processed and logout and

display login page

Success

Page 85: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

67

5.2 Conclusion

The information of the implemantation of the application is delivered by using test

cases. The test method is used to test the functionality of this application and

validation of the system on every module in the application.

Page 86: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

68

CHAPTER 6

DISCUSSION AND CONCLUSION

6.0 Introduction

In this chapter we will discuss about project contributions, constraint and future

works that can be taken into consideration for Food Intake For Diet (mobile apps)

and the conclusion.

Page 87: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

69

6.1 Project Contribution

The contribution of this application is to assists people with high reading of weight

and bmi to manage their health and lifestyles. Food intake plan recommendation

is to helps user that want to lose weight, contribute in reducing in obesity problems

and to implement rule-based food acquisition for diet. The recommendation helps

user to eat the healthy meal per day properly. The application also help user track

their body mass index (BMI) to encourage self-awareness. People need to take

good care of their health by following the guideline in the application.

6.2 Project Contribution and Limitation

There are a few constraint that discovered in this appication. The requirements

become so complicated in initial phase of development. The requirements caused

the plan and the output of application changed.

Besides, the current application is unable to tracks the user BMI and water when

it was calculated. User need to insert the right number to calculate BMI and water.

It considered as application limitation.

Page 88: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

70

6.3 Future Work

There are many improvements that can be done for this application. Firstly, ensure

our bmi and the water is directly insert once it was calculated. Next, make sure the

notification (reminder) can used and stated successful. Then, implement in mobile

application it can be easily accessed by user at anytime and anywhere. Lastly, add

planner module, make sure diet can calculate their calories and also which contain

diet suggestion.

6.4 Conclusion

As a conclusion, the application for Food Intake For Diet hoping that the apps can

contribute in reducing an obesity problems in Malaysia. This application aimed to

suggest the suitable diet plan for people with implement rule-based food

acquisition for diet. The methodology used to develop this application is

incremental and iterative model. Hopefully the application can help many people

in managing their weight and diet.

Page 89: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

71

REFERENCES

[1] Michelle C. Carter*, V. J. Burley, C. Nykjaer and J. E. Cade (2013)

‘My Meal Mate’ (MMM): validation of the diet measures captured

on a smartphone application to facilitate weight loss,

Nutritional Epidemiology Group, School of Food Science and Nutrition, Room G.07,

Food Science Building,University of Leeds, Leeds LS2 9JT, UK

British Journal of Nutrition (2013), 109, 539–546.

[2] Jackilen Shannon, Alan R. Kristal,1 Susan J. Curry, and

Shirley A. A. Beresford (1997).

Application of a Behavioral Approach to Measuring Dietary Change:

The Fat- and Fiber-related Diet Behavior Questionnaire.

Cancer Prevention Research Program, Fred Hutchinson Cancer Research

Center, Seattle, Washington 98104 [J. S.. A. R. K., S. A. A. B.]; Departments

of Epidemiology [A. R. K., S. A. A. B.l and Health Services [S. J. Cl.

University of Washington, Seattle, Washington 98 195; and Center for Health

Studies, Group Healthooperative of Puget Sound [S. J. C.], Seattle,

Washington 98104, May 1997 ,Vol. 6, 355-361.

[3] Gabrielle M Turner-McGrievy,1 Michael W Beets,2 Justin B Moore,1

Andrew T Kaczynski,1 Daheia J Barr-Anderson,3 Deborah F Tate4 (2013).

Comparison of traditional versus mobile app self-monitoring of physical activity and

dietary intake among overweight adults participating in an mHealth weight loss

program.

Department of Health Promotion, Education, and Behavior, Arnold School of Public

Health, University of South Carolina, Columbia, South Carolina, USA, 21 February

2013.

[4] Christopher M. Wharton, PhD; Carol S. Johnston, PhD, RD;

Barbara K. Cunningham, MEd, MS, RD; Danielle Sterner, MS, RD (2014).

Dietary Self-Monitoring, But Not Dietary Quality, Improves With Use of Smartphone

App Technology in an 8-Week Weight Loss Trial.

School of Nutrition and Health Promotion, Arizona State University, Phoenix, AZ

Address for correspondence: Christopher M. Wharton, PhD, School of Nutrition and

Health Promotion, Arizona State University, 500 North 3rd St, Phoenix, AZ 85004,

April 2, 2014.

[5] Thomas Meinert Larsen, Ph.D., Stine-Mathilde Dalskov, M.Sc.,

Marleen van Baak, Ph.D., Susan A. Jebb, Ph.D., Angeliki Papadaki, Ph.D., etc,

(2010). Diets with High or Low Protein Content and

Glycemic Index for Weight-Loss Maintenance.

From the Department of Human Nutrition, Faculty of Life Sciences (T.M.L., S.-M.D.,

A.A.), and the Department of Clinical Biochemistry, Gentofte Hospital (S.S.),

University of Copenhagen, November 25, 2010.

[6] M Garaulet1, P Go´ mez-Abella´n1, JJ Alburquerque-Be´ jar1, Y-C Lee2, JM

Ordova´s2,3,4 and FAJL Scheer5,6 (2012). Timing of food intake predicts weight loss

effectiveness.

Department of Physiology, Faculty of Biology, University of Murcia, Murcia, Spain, 1

October 2012.

Page 90: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

72

[7] A Lluch1,3, B Herbeth2*, L MeÂjean3 and G Siest, (2000).

Dietary intakes, eating style and overweight in the Stanislas Family Study.

BioPsychology Group, School of Psychology, University of Leeds, Leeds, UK;

2Centre de MeÂdecine PreÂventive, 54501 Vandoeuvre-les-Nancy, France; and

3INSERM U308, 54000 Nancy, France, 12 June 2000.

[8] James E Clark, (2015).

Diet, exercise or diet with exercise: comparing the effectiveness of treatment options

for weight-loss and changes in fitness for adults (18-65 years old) who are overfat, or

obese; systematic review and meta-analysis.

Division of Mathematics, Science, and Health Careers; Department of Science,

Manchester Community College, Manchester, CT 06045-1046, USA, 17 April 2015.

https://jdmdonline.biomedcentral.com/articles/10.1186/s40200-015-0154-1

[9] Damon L. Swift, Ph.D.,1,2 Neil M. Johannsen, Ph.D.,3,5 Carl J. Lavie,

M.D.,3,6 Conrad P. Earnest, Ph.D.,4 andTimothy S. Church, M.D., M.P.H., Ph.D.

(2014). The Role of Exercise and Physical Activity on Weight Loss and Maintenance.

Department of Kinesiology, East Carolina University, Greenville, NC 27858. 2014

Jan-Feb; 56(4): 441–447.

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3925973/

[10] Barbara Strasser and Dietmar Fuchs, (2016).

Diet Versus Exercise in Weight Loss and Maintenance: Focus on Tryptophon.

Division of Medical Biochemistry, Biocenter, Innsbruck Medical University,

Innsbruck, Austria, 2016 Jan 14.

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4864009/

[11] Barbara Strasser, Konstantinos Volaklis, Dietmar Fuchs, and Martin Burtscher,

(2017).

Role od Dietary and Muscular Fitnes on Longevity and Aging.

Division of Medical Biochemistry, Biocenter, Medical University Innsbruck,

Austria, 2017 Jan 14.

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5772850/

[12] Christopher C. Webster, Timothy D. Noakes, Shaji K. Chacko, Jeroen

Swart, Tertius A. Kohn, andJames A. H. Smith (2015).

Gluconeogenesis during endurance exercise in cyclists habituated to a long-term low

carbohydrate high-fat diet.

Division of Exercise Science and Sports Medicine (ESSM), Department of Human

Biology, Faculty of Health Sciences, University of Cape Town, Newlands, South

Africa, 2015 Nov 23.

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4967730/

Page 91: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

73

APPENDIX

APPENDIX A

Gantt Chart (Final Year I)

Week

Activity

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Topic discussion and

determination

Project Title proposal

Proposal writing Introduction

Proposal writing Literature

Review

Proposal progress

presentation & evaluation

Discussion correction

proposal & proposed solution

methodology

Proposal solution

Methodology

Proposal solution &

methodology (continue)

Proof of concept

Drafting report of the

proposal

Submit draft of report to

supervisior

Siminar presentation (final)

Correction report

Final report submission

Page 92: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

74

Gantt Chart (Final Year II)

Week

Activity

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Project discussion with

Supervisor

Project Development

Project Development

(continue)

Progress Presentation &

Evaluation (40%)

Project Development

(continue)

Project Testing

Project Testing (continue)

Submit Draf Report and

Documentation of the project

Seminat Presentation

Discussion & Correction

Report

Final Thesis Submission

Page 93: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

75

APPENDIX B

Implementation of connection coding with database (ConnectionClass.java)

package com.example.fifd;

import android.annotation.SuppressLint;

import android.os.StrictMode;

import android.util.Log;

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.SQLException;

public class ConnectionClass {

String classs = "com.mysql.jdbc.Driver";

String ur1 = "jdbc:mysql://192.168.43.48/FIFD";

String un = "root";

String password = "";

@SuppressLint("NewApi")

public Connection CONN(){

StrictMode.ThreadPolicy policy = new

StrictMode.ThreadPolicy.Builder()

.permitAll().build();

StrictMode.setThreadPolicy(policy);

Connection conn = null;

String ConnURL = null;

try {

Class.forName(classs);

conn = DriverManager.getConnection(ur1,un,password);

conn = DriverManager.getConnection(ConnURL);

} catch (SQLException se){

Log.e("ERRO",se.getMessage());

} catch (ClassNotFoundException e){

Log.e("ERRO",e.getMessage());

} catch (Exception e){

Log.e("ERRO",e.getMessage());

}

return conn;

}

}

Page 94: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

76

Implementation of Login / Sign up coding connection (welcome.xml)

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:app="http://schemas.android.com/apk/res-auto"

android:orientation="vertical"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:paddingLeft="18dp"

android:paddingRight="18dp"

android:background="@drawable/bg">

<ImageView

android:layout_width="250dp"

android:layout_height="200dp"

android:layout_gravity="center_horizontal"

android:padding="16dp"

android:outlineSpotShadowColor="@color/colorPrimaryDark"

android:layout_marginTop="20dp"

android:layout_marginBottom="16dp"

android:src="@drawable/logo1"/>

<ImageView

android:layout_width="250dp"

android:layout_height="200dp"

android:layout_gravity="center_horizontal"

android:padding="16dp"

android:outlineSpotShadowColor="@color/colorPrimaryDark"

android:layout_marginTop="0dp"

android:layout_marginBottom="16dp"

android:src="@drawable/welcome"/>

<Button

android:id="@+id/login"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_below="@+id/textView"

android:layout_centerHorizontal="true"

android:background="#cccc99"

android:textColor="#003300"

android:textSize="14sp"

android:padding="12dp"

android:layout_marginTop="0dp"

android:text="Login" />

<Button

Page 95: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

77

android:id="@+id/signup"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_below="@+id/textView"

android:layout_centerHorizontal="true"

android:background="#999966"

android:textColor="#fff"

android:textSize="14sp"

android:padding="12dp"

android:layout_marginTop="10dp"

android:text="Sign up" />

</LinearLayout>

Page 96: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

78

Implementation of Login / Sign up coding connection (welcome.java)

package com.example.fifd;

import android.content.Intent;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.Button;

public class welcome extends AppCompatActivity {

private Button login;

private Button signup;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_welcome);

login = (Button)findViewById(R.id.login);

login.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

openlogin();

}

});

signup = (Button)findViewById(R.id.signup);

signup.setOnClickListener(new View.OnClickListener(){

@Override

public void onClick(View v){

openchoosediet();

}

});

}

public void openlogin(){

Intent intent = new Intent(this,login.class);

startActivity(intent);

}

public void openchoosediet(){

Intent intent = new Intent(this,choosediet.class);

startActivity(intent);

}

}

Page 97: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

79

Implementation of Alarm/Remainder coding (fragment_add_edit_alarm.xml)

<?xml version="1.0" encoding="utf-8"?>

<ScrollView

xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

xmlns:app="http://schemas.android.com/apk/res-auto"

android:layout_height="wrap_content"

android:layout_width="match_parent"

android:scrollbarStyle="outsideOverlay"

android:background="@drawable/bg">

<LinearLayout

android:orientation="vertical"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:paddingTop="@dimen/activity_vertical_margin"

android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin">

<TextView

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:textAppearance="?android:attr/textAppearanceLarge"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

android:text="@string/time"

tools:text="Time"/>

<View

android:layout_width="match_parent"

android:layout_height="1dp"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

android:background="@drawable/divider" />

<TimePicker

android:id="@+id/edit_alarm_time_picker"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center"

android:layout_marginBottom="@dimen/activity_vertical_margin"

android:timePickerMode="spinner"

tools:targetApi="lollipop" />

<TextView

Page 98: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

80

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:textAppearance="?android:attr/textAppearanceLarge"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

android:text="@string/label"

tools:text="Label"/>

<View

android:layout_width="match_parent"

android:layout_height="1dp"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

android:background="@drawable/divider" />

<EditText

android:id="@+id/edit_alarm_label"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:inputType="textCapWords"

android:maxLength="15"

android:textColor="@color/secondary_text"

android:textStyle="italic"

android:hint="@string/add_label_hint"

android:layout_marginBottom="@dimen/activity_vertical_margin" />

<TextView

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:textAppearance="?android:attr/textAppearanceLarge"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

android:text="@string/days"

tools:text="Days"/>

<View

android:layout_width="match_parent"

android:layout_height="1dp"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

android:background="@drawable/divider" />

<android.support.v7.widget.GridLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

app:columnCount="2">

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

Page 99: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

81

app:layout_gravity="center_vertical|fill_horizontal"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

android:text="@string/monday"

tools:text="Monday"

/>

<CheckBox

android:id="@+id/edit_alarm_mon"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

app:layout_gravity="center_vertical"/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

app:layout_gravity="center_vertical|fill_horizontal"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

android:text="@string/tuesday"

tools:text="Tuesday"

/>

<CheckBox

android:id="@+id/edit_alarm_tues"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

app:layout_gravity="center_vertical"/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

app:layout_gravity="center_vertical|fill_horizontal"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

android:text="@string/wednesday"

tools:text="Wednesday"

/>

<CheckBox

android:id="@+id/edit_alarm_wed"

android:layout_width="wrap_content"

Page 100: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

82

android:layout_height="wrap_content"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

app:layout_gravity="center_vertical"/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

app:layout_gravity="center_vertical|fill_horizontal"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

android:text="@string/thursday"

tools:text="Thursday"

/>

<CheckBox

android:id="@+id/edit_alarm_thurs"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

app:layout_gravity="center_vertical"/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

app:layout_gravity="center_vertical|fill_horizontal"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

android:text="@string/friday"

tools:text="Friday"

/>

<CheckBox

android:id="@+id/edit_alarm_fri"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

app:layout_gravity="center_vertical"/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

app:layout_gravity="center_vertical|fill_horizontal"

Page 101: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

83

android:layout_marginBottom="@dimen/list_padding_vertical_small"

android:text="@string/saturday"

tools:text="Saturday"

/>

<CheckBox

android:id="@+id/edit_alarm_sat"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

app:layout_gravity="center_vertical"/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

app:layout_gravity="center_vertical|fill_horizontal"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

android:text="@string/sunday"

tools:text="Sunday"

/>

<CheckBox

android:id="@+id/edit_alarm_sun"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_marginBottom="@dimen/list_padding_vertical_small"

app:layout_gravity="center_vertical"/>

</android.support.v7.widget.GridLayout>

</LinearLayout>

</ScrollView>

Page 102: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

84

Implementation of Alarm coding (AddEditAlarmFragment.java)

package com.github.ppartisan.simplealarms.ui;

import android.content.DialogInterface;

import android.os.Bundle;

import android.support.annotation.Nullable;

import android.support.v4.app.Fragment;

import android.support.v7.app.AlertDialog;

import android.view.LayoutInflater;

import android.view.Menu;

import android.view.MenuInflater;

import android.view.MenuItem;

import android.view.View;

import android.view.ViewGroup;

import android.widget.CheckBox;

import android.widget.EditText;

import android.widget.TimePicker;

import android.widget.Toast;

import com.github.ppartisan.simplealarms.R;

import com.github.ppartisan.simplealarms.data.DatabaseHelper;

import com.github.ppartisan.simplealarms.model.Alarm;

import com.github.ppartisan.simplealarms.service.AlarmReceiver;

import com.github.ppartisan.simplealarms.service.LoadAlarmsService;

import com.github.ppartisan.simplealarms.util.ViewUtils;

import java.util.Calendar;

public final class AddEditAlarmFragment extends Fragment {

private TimePicker mTimePicker;

private EditText mLabel;

private CheckBox mMon, mTues, mWed, mThurs, mFri, mSat, mSun;

public static AddEditAlarmFragment newInstance(Alarm alarm) {

Bundle args = new Bundle();

args.putParcelable(AddEditAlarmActivity.ALARM_EXTRA, alarm);

AddEditAlarmFragment fragment = new AddEditAlarmFragment();

fragment.setArguments(args);

return fragment;

}

Page 103: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

85

@Nullable

@Override

public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup

container, @Nullable Bundle savedInstanceState) {

final View v = inflater.inflate(R.layout.fragment_add_edit_alarm,

container, false);

setHasOptionsMenu(true);

final Alarm alarm = getAlarm();

mTimePicker = (TimePicker)

v.findViewById(R.id.edit_alarm_time_picker);

ViewUtils.setTimePickerTime(mTimePicker, alarm.getTime());

mLabel = (EditText) v.findViewById(R.id.edit_alarm_label);

mLabel.setText(alarm.getLabel());

mMon = (CheckBox) v.findViewById(R.id.edit_alarm_mon);

mTues = (CheckBox) v.findViewById(R.id.edit_alarm_tues);

mWed = (CheckBox) v.findViewById(R.id.edit_alarm_wed);

mThurs = (CheckBox) v.findViewById(R.id.edit_alarm_thurs);

mFri = (CheckBox) v.findViewById(R.id.edit_alarm_fri);

mSat = (CheckBox) v.findViewById(R.id.edit_alarm_sat);

mSun = (CheckBox) v.findViewById(R.id.edit_alarm_sun);

setDayCheckboxes(alarm);

return v;

}

@Override

public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {

inflater.inflate(R.menu.edit_alarm_menu, menu);

super.onCreateOptionsMenu(menu, inflater);

}

@Override

public boolean onOptionsItemSelected(MenuItem item) {

switch (item.getItemId()) {

case R.id.action_save:

save();

break;

case R.id.action_delete:

delete();

Page 104: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

86

break;

}

return super.onOptionsItemSelected(item);

}

private Alarm getAlarm() {

return

getArguments().getParcelable(AddEditAlarmActivity.ALARM_EXTRA);

}

private void setDayCheckboxes(Alarm alarm) {

mMon.setChecked(alarm.getDay(Alarm.MON));

mTues.setChecked(alarm.getDay(Alarm.TUES));

mWed.setChecked(alarm.getDay(Alarm.WED));

mThurs.setChecked(alarm.getDay(Alarm.THURS));

mFri.setChecked(alarm.getDay(Alarm.FRI));

mSat.setChecked(alarm.getDay(Alarm.SAT));

mSun.setChecked(alarm.getDay(Alarm.SUN));

}

private void save() {

final Alarm alarm = getAlarm();

final Calendar time = Calendar.getInstance();

time.set(Calendar.MINUTE,

ViewUtils.getTimePickerMinute(mTimePicker));

time.set(Calendar.HOUR_OF_DAY,

ViewUtils.getTimePickerHour(mTimePicker));

alarm.setTime(time.getTimeInMillis());

alarm.setLabel(mLabel.getText().toString());

alarm.setDay(Alarm.MON, mMon.isChecked());

alarm.setDay(Alarm.TUES, mTues.isChecked());

alarm.setDay(Alarm.WED, mWed.isChecked());

alarm.setDay(Alarm.THURS, mThurs.isChecked());

alarm.setDay(Alarm.FRI, mFri.isChecked());

alarm.setDay(Alarm.SAT, mSat.isChecked());

alarm.setDay(Alarm.SUN, mSun.isChecked());

final int rowsUpdated =

DatabaseHelper.getInstance(getContext()).updateAlarm(alarm);

final int messageId = (rowsUpdated == 1) ? R.string.update_complete :

R.string.update_failed;

Page 105: NUR AQILAH BINTI KAMARUZAMANmyfik.unisza.edu.my/www/fyp/fyp18sem2/report/44633.pdf · food intake for diet mobile apps nur aqilah binti kamaruzaman bachelor of information technology

87

Toast.makeText(getContext(), messageId, Toast.LENGTH_SHORT).show();

AlarmReceiver.setReminderAlarm(getContext(), alarm);

getActivity().finish();

}

private void delete() {

final Alarm alarm = getAlarm();

final AlertDialog.Builder builder =

new AlertDialog.Builder(getContext(),

R.style.DeleteAlarmDialogTheme);

builder.setTitle(R.string.delete_dialog_title);

builder.setMessage(R.string.delete_dialog_content);

builder.setPositiveButton(R.string.yes, new

DialogInterface.OnClickListener() {

@Override

public void onClick(DialogInterface dialogInterface, int i) {

//Cancel any pending notifications for this alarm

AlarmReceiver.cancelReminderAlarm(getContext(), alarm);

final int rowsDeleted =

DatabaseHelper.getInstance(getContext()).deleteAlarm(alarm);

int messageId;

if(rowsDeleted == 1) {

messageId = R.string.delete_complete;

Toast.makeText(getContext(), messageId,

Toast.LENGTH_SHORT).show();

LoadAlarmsService.launchLoadAlarmsService(getContext());

getActivity().finish();

} else {

messageId = R.string.delete_failed;

Toast.makeText(getContext(), messageId,

Toast.LENGTH_SHORT).show();

}

}

});

builder.setNegativeButton(R.string.no, null);

builder.show();

}

}