Droppee is aimed to overcome the most common problem that most of the children avoid drinking water and also do not urinate at the right time. So, we intend to cope up with the problem by bringing in a smart bottle involves a smart watch application along with a game for the motivation of children to drink more water and to urinate when required. The existing similar projects Smart water or fluid intake smart systems and urine reminder or other trackers having different features separately are available in the market, but in Droppee we are coming up with a solution in which we are focusing on both drinking and urination habit trackers with enhanced features in one smart bottle.
The proposed project has fun filled game embedded on bottle to draw attention of kids to comply drink and urine habits and application that help parents to keep track of their child’s drinking habit and urination cycle on smartphone any time. Smart bottle prompts the child to drink water in order to achieve daily goals, drunk water will be calculated by a leveling sensor in the bottle in result score will increase and the flower character grow and for providing the flower character fertilizers child will be prompt to go to washroom. This urination activity can be input through smart watch application.
Acknowledgement/Dedication
First of all we would like to thank our supervisor Sir Qazi Shahab Azam who believed in us and was continuously supporting us in every problem that occurred during the working of this project. We especially thank him for his encouragement and his accurate comments which were of critical
importance, during this work. Our cooperation was truly an inspiring experience, we feel grateful. We are extremely thankful and indebted to our faculty members for sharing expertise, and sincere and valuable guidance and encouragement extended to us. We would like to dedicate this work to our beloved parents and family members who always believed in us, always were there and will always be whenever we need them.
Table of Contents
Acknowledgement...i
Abstract...iv
Chapter 1...1
1. Introduction...1
1.1 Scope...4
1.2 Limitations...5
Chapter 2...6
2. Literature Review...6
Chapter 3...16
3. Methodology...16
3.1 Features...17
3.2 Requirements...17
3.3 User Activities...19
3.4 Algorithm...20
3.5 Tools and Technology used...21
3.6 Working Model...22
3.7 Features (table)...25
Chapter 4...26
4. Bibliography...26
Chapter 5...35
5. Appendix...35
5.1 Entity Relationship Diagram...36
5.2 Use Cases...37
5.3 Process Flow Diagram...39
5.4 Class Diagram...42
5.5 Data Flow Diagram...43
5.6 Circuit Diagram...44
5.7 Test Cases...45
5.8 Graphical User Interface...87
5.9 Code...99
Abstract
Droppee is aimed to overcome the most common problem that most of the children avoid drinking water and also do not urinate at the right time. So, we intend to cope up with the problem by bringing in a smart bottle involves a smart watch application along with a game for the motivation of children to drink more water and to urinate when required.
The existing similar projects Smart water or fluid intake smart systems and urine reminder or other trackers having different features separately are available in the market, but in Droppee we are coming up with a solution in which we are focusing on both drinking and urination habit trackers with enhanced features in one smart bottle.
The proposed project has fun filled game embedded on bottle to draw attention of kids to comply drink and urine habits and application that help parents to keep track of their child’s drinking habit and urination cycle on smartphone any time. Smart bottle prompts the child to drink water in order to achieve daily goals, drunk water will be calculated by a leveling sensor in the bottle in result score will increase and the flower character grow and for providing the flower character fertilizers child will be prompt to go to washroom. This urination activity can be input through smart watch application.
Keywords:Water level indication, OLED, Arduino Mega 2560, Li-ion Battery, ESP8266.
Chapter # 1 Introduction
Kids usually avoid drinking water that is required on daily basis and also had a bad habit of holding urine. This seems like to be an ordinary situation but this could have significant consequences for their physical growth, emotional functionality and severe urinary infections, mostly bacterial infections that affect the urinary tract. Less intake of water can cause dehydration and several diseases. [1] [2] And Holding Urine can lead to much more serious diseases like Kidney stones, Cystitis, Swe ling of Bladder and the list goes on. We also surveyed 10 hospitals at different locations in Karachi, most of the doctors whom data was co lected were child specialists, and according to them most of them usua ly observe kid patients that suffering from dehydration and infections caused by urine retention.
For resolving this issue, smart water intake tracking products were made in pursuance to track child’s drinking habit throughout the day but these smart bottles had less functionalities and does not fulfilling the a lfeatures that are required. There are also applications and devices in market that uses various methods to determine the urinary output of a user as we l. [3] [4]
In our approach in pursuing this project named Droppee is to cater both of these issues single handedly by implementing the ways to track fluid intake and urine passing activities for the kids who have a bad habit of drinking of not drinking enough water or avoidance of going to washroom on appropriate time. By this
product parents will also get the facility to track their child’s fluid intake and washroom going needs and track whether their child is full filing their goals in order to stay healthy.
1.1 Scope:
► To lower the rate of diseases caused due to lack of water intake.
► To motivate the school going kids to drink more water.
► To induce the child to urinate at the certain time.
► To provide Parents a solution for tracking their child’s health including
their water drinking habit and urinating habit.
1.2 Limitations:
► Users of this product must have an internet connection to sync data on live servers, data including water level and urine activity input will be
stored locally if the smart bottle and fitness tracker is out internet zone.
► Although the bottle will be shockproof and water resistant, it has to be handled carefully for better performance.
► User must use manual input for tracking urine activity, it is not possible to embed a hardware device like sensors to human body, and therefore
there will be options available on fitness tracker and in mobile app to manually input the urine activity when it is performed.
Chapter # 2 Literature Review
When we don’t drink enough because of sickness or busy schedule so thirst is not always a reliable indicator of the body’s need for water. Most of the children experience severe diarrhea and vomiting. There are many ways to treat dehydration. If child becomes dehydrated treatment with an oral rehydration solution is the best option. There are several options which wi lgive child the right balance of electrolytes and salts. Try giving small sips or by the teaspoon to begin with. This even need to use a syringe if a child’s having trouble drinking. For an older child, sports drinks diluted with water are the best treatment. Again, start with sma l sips and give him more as he shows he can tolerate it. [5] [6] [7] [8] [9] [10] [11]
[12] [13] [14] [15] [16]
Infants and children who are dehydrated should also take an oral rehydration solution. When they're dehydrated, lose sugar and salts, as we las water. The solution should contain a mixture of potassium and sodium salts, as well as glucose or starch. [17] [18]
Clinical assessment of dehydration can be difficult, especially in young infants, and rarely predicts the exact degree of dehydration. Clinical assessment may be
particularly inaccurate when assessing children with moderate dehydration. The history and laboratory tests provide only modest benefit in assessing dehydration. Treat suspected infusion of 20 ml/kg of 0.9% sodium chloride solution [19] [20] [21]
It's important to know the early signs of dehydration and to respond quickly if a child has them. The goal in treating dehydration is to replace fluids and restore
body fluids to normal levels. Kids who are mildly dehydrated from lots of activity will probably be thirsty and should drink as much as they want. Plain water is the best option. They should rest in a cool, shaded spot until the lost fluid has been replaced. Kids with mild to moderate dehydration due to diarrhea from an illness (like gastroenteritis) should have their lost fluids replaced. This is known as rehydration. It's done by giving a special liquid called an oral rehydration solution (ORS)over the course of 3 to 4 hours. [22] [23]
Sodium and glucose in the correct proportions can be passively cotransported with fluid in the body. Rapid oral rehydration with the appropriate solution has been shown to be as effective as intravenous fluid therapy in restoring intravascular volume and correcting acidosis. [24]
For severe dehydration, hospitalization is sometimes necessary so that your child can be rehydrated intravenously. In milder cases, all that may be necessary
is to give child an electrolyte replacement solution according to your pediatrician’s directions. Once a child has been on an electrolyte solution for twelve to twenty-four hours and the diarrhea is decreasing, you gradua ly may expand the diet to include foods such as applesauce, pears, bananas, and flavored gelatin, and milk. [25]
If a child needs an oral rehydration solution (ORS). Oral rehydration solutions contain the right mix of salt, sugar, potassium, and other minerals to help replace lost fluids. [26]
Most of the volume loss in dehydration is extracellular fluid. The goal of rehydration therapy is first to restore the circulating blood volume, if necessary; then to restore the fluid volume; and fina ly, to maintain hydration. ORT (Oral Rehydration Therapy) is as effective fluid in rehydration of children with mild to moderate dehydration. [27]
Oral rehydration is the first line of treatment according to current guidelines. The second line of treatment should be the giving of rehydration solution through a nasogastric tube. These methods are being underused according to current reports. [28]
Children who are dehydrated due to an illness such as diarrhea or vomiting may have their fluid losses replaced with an oral rehydration solution (ORS). An ORS has the correct amount of electrolyte salts and Sugar needed to help the
body absorb exactly what it needs. Avoid juices. These do not have the right combinations of salts and may even make diarrhea worse. [29]
Maintaining good fluid levels is vital to avoid dehydration. This can be helped by continuing drinking water. Babies may also be given boiled water in-between feeds which will also help to keep their fluid levels up. [30]
For Urine Retention there are the following treatments:
If child is already in school and he is still wetting the bed at night and limiting liquids after dinner. Child should wake up in the middle of the night and have to empty his bladder. [31]
To prevent urine retention problem children should urinate on a schedule. This is ca led “timed voiding.” This means going to the bathroom every 2 to 3 hours during the day. Some children may need to go more often. [32] [33]
People can prevent urinary retention before it occurs by treating some of the potential causes. Timed voiding schedule. Using the bathroom every 2 hours during the day in the morning, at mid-morning break, lunchtime, mid-afternoon break, home from school, before dinner and just prior to bedtime. [34]
Increase the daytime fluids by drinking 6 to 8 glasses of water per day and then shift fluid intake to the beginning and middle of the day and limit fluid intake in the afternoon and especially after 5:30PM. [35]
Drinking plenty of fluids, particularly water, taking one teaspoon of baking soda or bicarbonate of soda in water to help to a l eviate the discomfort of burning and scalding when passing urine. [36]
Most UI fades away naturally as a child grows and develops and does not require treatment. When treatment is needed, options include bladder training and related strategies, moisture alarms, and medications. [37] [38]
Urinary retention is a side effect of the bladder not emptying properly. This is also known as having residual urine. If this problem occurs and it is starting to affect day to day life make an appointment to see doctor, continence nurse or specialist physiotherapist. [39]
There are many signs that your child may be holding their urine. Children with these habits may squat down on their heels, cross their legs, or hold between their legs to keep from wetting. Other children may urinate sma lamounts often and not empty their bladders a lthe way. They might urinate only until they relieve the feeling of pressure or because they are in a hurry even though their bladders are not empty. [40] [41]
Kidney stones have many causes and can affect any part of urinary tract from kidneys to bladder causing severe pain in the side, back and below the ribs. [42]
Urinary Tract Infections (UTIs)/ Cystitis,UTI is a feeling like burning when urinating and pain or pressure in back or lower abdomen. [43]
A bladder infection is caused by a bacterial infection within the bladder in people with weak immune system when bacteria that enter through the urethra and move into the bladder cause bladder infections. Norma ly the body removes the bacteria by flushing them out during urination. Still bacteria can sometimes attach to the wa ls of the bladder and multiply quickly. [44] [45]
To overcome less fluid intake of water, other similar products were also made and are available in the market right now, but most of these products not particularly focus on kids. Here’s a list of similar products for tracking fluid in the market: [46]
Moikit smart bottle goal is to create the useful smart vacuum bottle which is used to maintain water temperature. As compare to this product our product is having a game imbedded on the bottle. [47]
Trago smart bottle can measure the change level in the bottle. It also works for any fluid not just the water. It is attached with the fitness device along with the App for the hydration impact. The enhancement in our product is having a urine tracker to monitor urination habit. [48]
The Hydra Smart Bottle smart bottle having multiples features such as 600ml water capacity along with 4000 mA power Bank. It also has lightning system, Bluetooth speakers and Speaker phone. The Sleeper App is also paired with it. But Droppee is having an application which is going to maintain drinking and urination habit through statistics along with notifications or pop ups to have water or pass urine. [49]
H2Opal Smart bottle automatically tracks the intake and synchronized the data with smartphone. Sends timely notification to stay well hydrated with a goal which measure progress over time. The innovation we come up to have a fitness tracker along with the smart bottle. [50]
Ozmo Smart Bottle connects with the Ozmo App to record both water and coffee consumption and tracks progress throughout the day to help to reach the hydration goals. It syncs with Fitbit, Apple Watch, and other fitness trackers to re-evaluate hydration needs post-workout. Our product can also measure the change of water level in the bottle. [51]
Sportline HydraCoach Intelligent Water Bottle Calculates the personal hydration needs and tracks fluid consumption through the day paces to ensure hydration goals are met. As compare to Droppee it is having an anti-cheat mechanism which is going to give notification and circuit cut off when bottle would be open. [52]
Thermos 24 Ounce Hydration Bottle with Connected Smart Lid measures the intake of liquids while providing real-time temperature readings. The Hydration Calculator calculates the suggested hydration goal based on the personal data. It provides chart and graph daily, weekly, and monthly hydration progress. But in our product, it is having a battery backup in a smart bottle and fitness tracker as well. [53]
Drink Water Reminder PYRUS 320ml Smart Cup Health Sensor 8 times Drinking Reminder Alarm with LED Screen Display. It’s a time health intelligent remind cup. Taken the intelligent sensing technology, regularly remind to drink water. As compare to Droppee it is water resistant smart bottle.
[54]
Fruit Water Infusion Bottle Juicer Hydration with measurement marking measures how much water you drink and tracks a lday intake by hour in order to encourage you achieve your daily water consumption. [55]
Hidrate Spark smart water bottle will keep track of how much you drink and help you meet your daily hydration goal. The glow of the bottle lights up and flashes to reminds to drink. [56]
Blufit Water Bottle works with your smartphone; its app co l ects various factors such as your weight, age, temperature and humidity to determine exactly how much water you need. As you drink from your Blufit bottle, it records
automatically the time and amount of water intake and sends the data to your smartphone and keeps you healthy and hydrated. [57]
During our research we also find out that not many people are focusing on the habit of urine retention. Although this is a severe problem which affects human health in a bad way, but there is only an application out there in the market to focus urine tracking habits that is Pee & See - Drink more wateris a simple water reminder app. It doesn't need to know when you drink water or how much you drink. When you haven't peed for 3 hours you' l get a reminder to drink water except at night. Droppee’s Application will remind via notification when a child hasn’t drink for 1 or 2 hours. [58]
An Intelligent water bottle that can precisely measure the amount of liquid in the bottle, monitor activity using inertial sensors, and physiological parameters using a touch and photoplethysmographic sensor. We evaluate two system configurations: a smart water bottle integrated into a personal body sensor network and a cloud based device. [59]
We surveyed 10 different hospitals from Karachi to gather statistics of patients suffering from diseases caused by dehydration and urine retention. Following is the list of this survey:
Name
Patients
PTD
DD
UD
OT
Dr. Sahar Pervez (Child Specialist)
Hamdard Hospital Nazimabad # 3, Petrol Pump, Opp. Eidgah Ground, Karachi.
80%
1%
18%
15
Dr. Saleem Mukadam (Child Specialist)
Florence Hospital, Nazimabad Block-H, Karachi.
76%
2%
22%
20
Dr. Saima (Child Specialist)
Godhra Hospital, Sector 11G, North Karachi, Godhra Rd, Karachi
70%
0%
30%
Dr. Rahman (Child Specialist)
Rahman Clinic Bagh-e-Zohra Appt. Opp. Bohri Mosque Street Saddar, Karachi.
45%
5%
50%
14
Dr. Farseem Wahaj (Child Specialist)
Haleem Hospital, D-13, Block L, North Nazimabad, Karachi.
40%
0%
60%
13
Dr. Afsar Qureshi (Child Specialist)
Mariam Clinic, Shaheed-e-Millat Express way, Karachi.
70%
2%
28%
13
Dr. Khalid Shafi (General Physician)
Shafi Clinic, C-Area, Qayyumabad, Karachi
20%
5%
75%
27
Dr. Salman Qazi (Child Specialist)
60%
0%
40%
13
Park Lane Hospital, Shahrah-e-Iran, Clifton, Karachi.
Total
58%
02%
40%
► PTD – Patients/day approximately.
► PT – Patients.
► UD – Patients with Urinary Diseases.
► DD – Patients with Dehydration Diseases.
► OT – Other Patients.
Patients
Urinary:
2%
Others: 40%
Dehydration:
58%
Urinary Dehydration Others
Chapter # 3 Methodology
Our project is dependent on hardware. It includes a bottle, a fitness tracker and a mobile application to integrate smart bottle and the fitness tracker.
3.1 Features:
► Water intake tracking.
► Urine activity tracking.
3.2 Requirements:
► Smart Bottle.
► Smart Watch App.
► Mobile Application.
► Smart Bottle:
► In Smart Bottle Arduino Mega 2560 will be used as an open source computer hardware. [60]
► Smart bottle will be consisted of SD card reader slot for reading of Images and animations from memory card. [61] [62] [63]
► Bottle will contain an ESP 8266 module for radio communication.
► It would be water resistant and shock proof.
► An OLED will be embedded on the bottle for display. [64]
► Bottle will contain a Li-ion battery for portable use. [65]
► Bottle will display number of glasses to drink for a day.
► Bottle will display number of glasses that are already drunk by child.
► Bottle will display number of times a child should go to washroom.
► Bottle will display how many times child gone to washroom.
► Bottle will display notification message for water intake.
► Bottle will display notification message for urination.
► Smart Watch Application:
► Input for urine activity tracking.
► Smart watch application will display name of child.
► Smart watch application will display number of glasses to drink for a day.
► Smart watch application will display number of glasses that are already drunk by child.
► Smart watch application will display number of times a child should go to washroom.
► Smart watch application will display how many times child gone to washroom.
► Smart watch application will display notification message for water intake.
► Smart watch application will display notification message for urination.
► Mobile Application:
► Guardians can track their child’s water intake level.
► Guardians can track their child’s urine activity throughout the day.
► Guardians can keep track of fitness data recorded with fitness tracker.
► Guardians can manua ly notify the children to drink water or go to urinate.
► Guardians can share the fitness, fluid intake and urine activity statistics with doctor.
Game:
A game will be embedded in the bottle, this game will be consisting of flower character, a child can have personalized profile, they will have the option, as a child drinks water according the given task, his/her score will increase with the amount of water they drink, and as fertilizer to keep the plant safe from germs, game will notify the kid to go to pee as motivation to keep their flower healthy. Children can input pee activity by inputting in the fitness tracker.
3.3 User Activities:
Kids:
► Child play game as he/she drink water or go to urinate.
► Scores can be shared.
Parents:
► Authorized guardian will able to monitor child’s urine activity and water
intake report.
► Guardian can share statistics with doctor for better insight on the health of the child.
3.4 Algorithm
For Calculating Water Intake needs:
Formula Method
(100 ml for each of the first 10 kg) + (50 ml for each kg 11 - 20) + (20 ml for each additional kg) / 24 hour
Example:
Calculate the hourly maintenance fluid rate for a child who weighs 25kg (100 ml x 10 kg) + (50 ml x 10 kg) + (20 ml x 5 kg) / 24 hrs
(1000 ml) + (500 ml) + (100 ml) = 1600 ml / 24hrs = 66.7 ml/hr
Using this formula the hourly fluid maintenance for this child is 67 ml/hr Converting this to number of glasses required for 24 hours = 1600 ml / 250 ml
= 6.4 glasses.
Fo lowing is the table for water indication points and their values co lected from bottle:
This table is not included in the reading sample.
For Calculating Urination needs:
Number of times to urinate = Number of total glasses to drink / 1.5
3.5 Tools and Technologyused:
► Android Studio.
► Native Java.
► PHP.
► Slim Framework (For Api routing).
► Arduino IDE.
► C++.
► GIMP (For image processing).
3.6 WorkingModel:
This figure is not included in the reading sample.
This figure is not included in the reading sample.
A game screen embedded on smart bottle that will attract child towards water drinking. As the child drink water, it will add up to the score of the child and push the score over a server through a wireless signal using Wi-Fi network connection. An anti- cheat mechanism is going to be use in this smart bottle so that a child cannot cheat parents that he/she drinks water. Built-in battery will allow smart bottle to stay updated and connected with
parents and server. And port-less charging even a lows a kid to put the smart bottle on charging easily.
This figure is not included in the reading sample.
Similarly, as the application reminds the child to go to urinate after certain intervals, scores would be added up as the child manua ly input when the urine activity is performed. An input is taken from child over a health band. And score will be updated on a server through a wireless signal using Wi-Fi network connection.
This figure is not included in the reading sample.
Parents can access child’s information through an application over the server on
smart phone anywhere anytime.
On starting the application first time, application will prompt the user to create a parent account.
Once the parent account is set, a child account can be set.
Child account procedure will take user to the process in which name, age, height, nickname and character of child will be asked.
3.7Features:
This table is not included in the reading sample.
Chapter # 4 Bibliography
[1] Claudia Tanner (October 19, 2017), “Children drink just a quarter of the amount of water they should during the school day and parents blame head teachers for banning squash”, URL: http://www.dailymail.co.uk/health/article- 4997662/SCHOOLS-blamed-children-not-drinking-water.html
[2] Lennox H Huang, MD, FAAP (Nov 25, 2016), “Dehydration Clinical Presentation.” URL: https://emedicine.medscape.com/article/906999-clinical
[3] Alexis Jenkins (August 14, 2017), “Normal Bladder Capacity in Children.” URL: https:// www.livestrong.com/article/276793-normal-bladder-capacity-in- children/
[4] Bec Crew (January, 14, 2016), “What Happens When You Hold in Your Pee?” URL: https://www.sciencealert.com/watch-what-happens-when-you- hold-in-your-pee/
[5] E ly Berger (September 8, 2015), “Dehydration.”
URL:
http://www.aboutkidshealth.ca/En/HealthAZ/ConditionsandDiseases/Sympto ms/Pages/Dehydration.aspx/
[6] Sagari Gongala (April 5, 2017), “15 Signs and Symptoms of Dehydration in Children.”
URL: http://www.momjunction.com/articles/dehydration-in-children- signs- and-symptoms_00414852/#gref/
[7] Robert Ferry Jr.MD (October 21, 2016), URL: https:/ /www.emedicinehealth.com/dehydration_in_children/article_em.htm/
[8] Alphin Jornay (March 11, 2017), “Dehydration in children.” URL:
https://www.babycenter.com/0_dehydration-in-children_11407.bc/
[9] Judith Marcin MD (June 26, 2017), “What Is a Bladder Infection?” URL:
https://www.healthline.com/health/bladder-infection/
[10] Saul P. Greenfield (April 24, 2017), “Symptoms & Causes of Bladder Infection in Children.” URL: https:// www.niddk.nih.gov/health- information/urologic-diseases/urinary-tract-infections-in-children/symptoms-
causes/
[11] Nuhospitals (January 6, 2016), “Urinary Tract Infection in Children.”
URL: https://www.nuhospitals.com/blog/urinary-tract- infection-in-children/
[12] Bresee JS, Duggan C (October1 9, 2017), “Diagnosis and Management of Dehydration in Children.” URL: http://www.aafp.org/afp/2009/1001/p692.html/
[13] RN Remedies (July 11, 2015). “Urinary Tract Infections: Signs, Symptoms and When to See the Doctor.” URL: https:// www.chla.org/blog/rn- remedies/urinary-tract- infections-signs-symptoms-and-when-see-the-doctor
[14] Canadian Paediatric Society (November 13, 2016), “Oral rehydration
therapy and early refeeding in the management of childhood gastroenteritis.”
URL: https://www.cps.ca/en/documents/position/oral-rehydration-therapy/
[15] Michael J. Steiner, MD (September 16, 2016), “Is This Child Dehydrated?”
URL:
https://fhs.mcmaster.ca/pediatrics/documents/IsThisChildDehydrated.pdf
[16] Darren A. DeWalt, MD, MPH (May 7, 2015), “how to prevent and treat dehydration.” URL: http://www.leidenhuisarts.nl/bestanden/How-to-prevent- and-treat-dehydration-ENGLISH.pdf
[17] Robert William (April 4, 2015), “Dehyrdation.” URL:
https:// www.nhs.uk/conditions/dehydration/treatment/
[18] Julie S. Byerley (June 2, 2016), “Urinary Tract Infections in Childhood.” URL: http://www.monashchildrenshospital.org/wp- content/uploads/2016/10/urinary-tract-infection-child.pdf
[19] Dr. Colin Tidy (23 Apr, 2014), “Dehydration in Children.” URL:
https://patient.info/doctor/dehydration- in-children#nav-1/
[20] Linthicum (December 5, 2015), “Urinary Tract infections in children.”
URL:
https:// www.kidneys.co.nz/resources/file/urinary_tract_infections_in_children
_03.pdf
[21] St. Louis (August 9, 2016), “Urinary Tract Infection.” URL: http://www.stlouischildrens.org/sites/default/files/health_resources/familyreso urce/files/Urinary%20Tract%20Infections5.pdf
[22] Tom Clinton, (May 5, 2016), “What Is Dehydration?”
URL:http://kidshealth.org/en/parents/dehydration.html
[23] Elsevier (July 15, 2017) “Urinary Tract Infections.” URL: http://www.impcna.com/intranet/Nelson%20Pediatric/Kidney- Urinary%20Tract/UrinaryTractInfections%5B1%5D.pdf
[24] Lennox H Huang, MD, FAAP; Timothy E Corden, (November 27, 2016)
“Dehydration Treatment & Management.”
URL:https://emedicine.medscape.com/article/906999-treatment/
[25] Pattison Clan (November 21, 2015), “Treating Dehydration with Electrolyte Solution.” URL:https:// www.healthychildren.org/English/health- issues/conditions/abdominal/Pages/Treating-Dehydration-with-Electrolyte-
Solution.aspx/
[26] Alizey (December 3, 2016), “Oral Rehydration Solutions for Children.” URL: https:// www.webmd.com/children/tc/oral-rehydration-solutions-for- children-topic-overview/
[27] Am Fam Physician (October 1, 2016), “Diagnosis and Management of Dehydration in Children.” URL: http://www.aafp.org/afp/2009/1001/p692.html/
[28] Kristina Suson (January 5, 2016), “Pediatric Urinary Tract Infections and Catheterization in Children with Neurogenic Bladder and Bowel.” URL: http://spinabifidaassociation.org/wp-content/uploads/2015/07/PEDIATRIC-
URINARY-TRACT-INFECTIONS2.pdf
[29] D. Caselli (September 19, 2015), “Parents’ Attitudes toward Oral Rehydration Therapy in Children with Mild-to-Moderate Dehydration.” URL: https://www.hindawi.com/journals/tswj/2013/828157/
[30] Jacquelyn (December 8, 2016), “The Warning Signs of Dehydration in Toddlers.” URL:https:// www.healthline.com/health/parenting/signs-of- dehydration- in-toddlers#next-steps7/
[31] Andrew William (October 6, 2015), “How to Help Your Child Stop Wetting the Bed.” URL:https://health.clevelandclinic.org/2014/05/how-to- help-your-child-stop-wetting-the-bed-2/
[32] J. Johansan (May 7, 2017), “Urinary Tract Infections.”, URL:
https:// www.seattlechildrens.org/pdf/PE179.pdf
[33] Wilson Blvd (February 24, 2017), “Fluid Facts for Kids.” URL: https://wicworks.fns.usda.gov/wicworks/Sharing_Center/WY/Hydration/Displ ay_Elements/hydrationfluidfacts.pdf
[34] J. Curtis Nickel (September 26, 2015), “Urinary Retention.” URL:
https:// www.niddk.nih.gov/health-information/urologic-diseases/urinary- retention/
[35] Mary Gheen, APRN (June 19, 2016), “Bowel and Bladder Dysfunction in Children.” URL:
https://elliothospital.org/_wmur/Articles/bowel%20and%20bladder%20dysfun ction.pdf/
[36] Jevant Ghulam (September 5, 2015), “URINARY TRACT INFECTIONS.” URL: http://kidney.org.au/cms_uploads/docs/urinary-tract- infections- fact-sheet.pdf/
[37] Shreeram S, He JP, Kalaydjian A, Brothers S, Merikangas KR. Journal of the American Academy of Child and Adolescent Psychiatry (January 4, 2016), “Urinary Retention.” URL: UI-Children_508.pdf/
[38] A. Grandjean (August 2, 2016), “Urinary Tract Infections.” URL:
http://www.who.int/water_sanitation_health/dwq/nutwaterrequir.pdf
[39] Debra Evans (September 11, 2017), URL: https:// www.bladderandbowel.org/bladder/bladder-conditions-and- symptoms/urinary-retention/
[40] Harley Pattison (December 5, 2015), URL: https:// www.seattlechildrens.org/pdf/PE179.pdf
[41] Dr. Emma Derbyshire PhD (March 3, 2017), “HYDRATION AND URINARY TRACT HEALTH.” URL:
http://www.naturalhydrationcouncil.org.uk/wp- content/uploads/2013/04/NHC-Urinary-Fact-Sheet_March13.pdf
[42] Dr. Rose Marley, (January 3, 2017), “Kidney stones.” URL:
https:// www.mayoclinic.org/diseases-conditions/kidney-stones/.../syc- 20355755/
[43] Jerry R. Balentine (May 25, 2015), URL: https:/ /www.medicinenet.com/urinary_tract_infection/article.html/
[44] Judith Marcin MD (June 26, 2017), “What Is a Bladder Infection?” URL:
https://www.healthline.com/health/bladder-infection/
[45] Dr. Joan Gandy, Dietitian (March 5, 2017), “Food Fact Sheet.” URL:
https:// www.bda.uk.com/foodfacts/fluid.pdf
[46] Emil Jovanov (December 27, 2015), “Smart Stuff: A Case Study of a Smart Water Bottle.” URL: http://www.ece.uah.edu/~jovanov/papers/C2016_Jovanov_smartstuff.pdf
[47] Moikit Smart Water Bottle, (May 19, 2017), “Moikit - Sports Bottle
Revolutionized.” URL: http://www.moikit.com/pro/gene#posi/
[48] Trago, Smart Water Bottle (June 21, 2016), URL https://trago.co/pages/trago-cap/
[49] Open2-LLC, Smart Water Bottle (August 11, 2016), “Hydra - Smart
Bottle.” URL: http://hydra-smartbottle.com/
[50] H2OPal, Smart Water Bottle (December 4, 2015), URL: https:// www.h2opal.com/
[51] Broking lab, Smart Water Bottle (May 6, 2017), URL: https:/ /www.ozmo.io/
[52] Sportline, (September 15, 2015), URL: https:// www.amazon.com/Sportline-Hydracoach-Intelligent-Water-Bottle-
Blue/dp/B000O3Q6FG?tag=wraws-20/
[53] Thermos, (June 4 2015), URL: https:// www.amazon.com/Thermos-Ounce-
Hydration-Bottle-Connected/dp/B00ZQUNHO0?tag=wraws-20&th=1/
[54] PYRUS, Smart Water Bottle (April 18, 2016), URL: https:// www.amazon.com/Reminder-PYRUS-Health-Drinking- Display/dp/B01EF6F0E0?tag=wraws-20/
[55]
Slomg,
Smart
Water
Bottle
(October
16,
2017),
URL:
https:// www.amazon.com/dp/B075LT2SWY?psc=1/
[56] Hidrate Spark, Smart Water Bottle (August 29,
2017),
URL:
https://hidratespark.com/
[57] Crooked Brains, Smart Water Bottle (January 25.
2015),
URL:
http://www.crookedbrains.net/2015/01/smart-beverage-and-water-
bottles.html/
[58] Ganotis Holdings, Pee Track Application (January 30, 2017), URL: https://itunes.apple.com/pk/app/pee-see-drink-more-
water/id1090749982?mt=8/
[59] Emil Jovanov, Vindhya R Nallathimmareddygari, and Jonathan E. Pryor (September 9, 2015), URL: http://www.ece.uah.edu/~jovanov/papers/C2016_Jovanov_smartstuff/
[60] Zach DeMeyer, (December 8, 2017) “Arduino Mega 2560 Overview — The Uno’s Big Brother” URL: https://store.arduino.cc/usa/arduino-mega-2560- rev3
[61] Louisiana (August 21, 2015), “LSU Math Students Create a Detection Interface to Help Pennington Biomedical Researchers Measure Infant Sucking Behavior” URL:
http://www.lsu.edu/science/news_events/CoSMagazine/PowerofMath_Pursuit e_2016-17.php
[62] Automation Products Group, Inc. (APG) (July 13, 2017), “Ultrasonic Level Sensors.” URL: https://www.apgsensors.com/ultrasonic-level-sensors
[63] Ametherm (May 9, 2015), “What Is an NTC Thermistor.” URL:
https:// www.ametherm.com/thermistor/what-is-an-ntc-thermistor
[64] Herbert (November 24, 2017), “OLED.” URL: https://en.wikipedia.org/wiki/O LED
[65] Syzdek L.A (November 25, 2017), “Lithium-ion battery.” URL:
https://en.wikipedia.org/wiki/Lithium- ion_battery
Chapter # 5 Appendix
Parts of the Appendix are not included in the reading sample.
5.9 Code:
Android Code:
toolbar.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize " android:background="?attr/colorPrimary"
local:theme="@style/ThemeO verlay.AppCompat.Dark.ActionBar" local:popupTheme="@style/ThemeO verlay.AppCompat.Light" />
parent_profile.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView android:layout_height="fill_parent" android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin"
tools:context="info.androidhive.materialdesign.activity.FriendsFragment">
<android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:id="@+id/date" android:focusable="true" android:layout_marginBottom="8dp">
<EditText android:id="@+id/datess" android:clickable="true" android:inputType="none"
android:focusable="false" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Date" android:textColorHint="@color/colorPrimary"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:id="@+id/rec" android:layout_below="@+id/date" android:layout_marginBottom="8dp">
<fr.ganfra.materialspinner.MaterialSpinner android:id="@+id/spinner_rec" android:layout_width="match_parent" android:layout_height="wrap_content" app:ms_multiline="false" app:ms_hint="Select Account" app:ms_enableFloatingLabel="false"
app:ms_enableErrorLabel="false" app:ms_floatingLabelText="floating label" app:ms_baseColor="#9f9d9d" app:ms_highlightColor="@color/colorPrimary" app:ms_errorColor="@android:color/holo_red_dark" app:ms_thickness="0.75dp" app:ms_hintColor="#000" app:ms_arrowColor="@color/colorPrimaryDark" app:ms_arrowSize="14dp" app:ms_alignLabels="false" app:ms_floatingLabelColor="@color/colorAccent"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:id="@+id/transfer_to" android:layout_below="@+id/rec" android:layout_marginBottom="8dp">
<fr.ganfra.materialspinner.MaterialSpinner
android:id="@+id/spinner_transfer" android:layout_width="match_parent" android:layout_height="wrap_content" app:ms_multiline="false" app:ms_hint="Select Account" app:ms_enableFloatingLabel="false" app:ms_enableErrorLabel="false" app:ms_floatingLabelText="floating label" app:ms_baseColor="#9f9d9d"
app:ms_highlightColor="@color/colorPrimary" app:ms_errorColor="@android:color/holo_red_dark" app:ms_thickness="0.75dp" app:ms_hintColor="#000" app:ms_arrowColor="@color/colorPrimaryDark" app:ms_arrowSize="14dp" app:ms_alignLabels="false" app:ms_floatingLabelColor="@color/colorAccent"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_co ntent"
android:layout_marginTop="8dp" android:id="@+id/pay_to" android:layout_below="@+id/transfer_to" android:layout_marginBottom="8dp">
<fr.ganfra.materialspinner.MaterialSpinner android:id="@+id/spinner_pay_to" android:layout_width="match_parent" android:layout_height="wrap_content" app:ms_multiline="false" app:ms_hint="Jobs" app:ms_enableFloatingLabel="false" app:ms_enableErrorLabel="false" app:ms_floatingLabelText="floating label" app:ms_baseColor="#9f9d9d"
app:ms_highlightColor="@color/colorPrima ry" app:ms_errorColor="@android:color/holo_red_dark" app:ms_thickness="0.75dp" app:ms_hintColor="#000" app:ms_arrowColor="@color/colorPrimaryDark" app:ms_arrowSize="14dp" app:ms_alignLabels="false" app:ms_floatingLabelColor="@color/colorAccent"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:id="@+id/jobs" android:layout_below="@+id/pay_to" android:layout_marginBottom="8dp">
<fr.ganfra.materialspinner.MaterialSpinner android:id="@+id/spinner_jobs" android:layout_width="match_parent" android:layout_height="wrap_content" app:ms_multiline="false" app:ms_hint="Jobs" app:ms_enableFloatingLabel="false" app:ms_enableErrorLabel="false" app:ms_floatingLabelText="floating label" app:ms_baseColor="#9f9d9d"
app:ms_highlightColor="@color/colorPrimary"
app:ms_errorColor="@android:color/holo_red_dark" app:ms_thickness="0.75dp" app:ms_hintColor="#000" app:ms_arrowColor="@color/colorPrimaryDark" app:ms_arrowSize="14dp" app:ms_alignLabels="false" app:ms_floatingLabelColor="@color/colorAccent"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:id="@+id/desc" android:layout_below="@+id/jobs" android:layout_marginBottom="8dp">
<EditText android:id="@+id/description" android:layout_width="match_parent"
android:layout_height="wrap_content" android:hint="Description" android:textColorHint="@color/colorPrimary"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:id="@+id/rec_amount" android:layout_below="@+id/desc" android:layout_marginBottom="8dp">
<EditText android:id="@+id/receive_amount" android:inputType="number" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Receive Amount"
android:textColorHint="@color/colorPrimary"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:id="@+id/remark" android:focusable="false" android:layout_below="@+id/rec_amount" android:layout_marginBottom="8dp">
<EditText android:id="@+id/remarks" android:inputType="text"
android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Remarks/Note" android:textColorHint="@color/colorPrimary"/>
</android.support.design.widget.TextInputLayout>
<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content"
android:id="@+id/radio" android:layout_below="@+id/remark" android:orientation="vertical">
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Debit from customer account"/>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Will charge on Invoice"/>
</LinearLayout>
<android.support.v7.widget.AppCompatButton android:id="@+id/btn_login" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_marginTop="24dp" android:layout_marginBottom="24dp" android:padding="12dp" android:textSize="20sp" android:layout_below="@+id/radio"
android:shadowColor="@color/colorPrimaryDark" android:textStyle="bold" android:background="@color/colorPrimary" android:textColor="#ffffff"
android:text="Submit Expense"/>
</RelativeLayout>
</ScrollView>
activity_login.xml
<?xml version="1.0" encoding="utf-8"?>
<Scro lView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:fitsSystemWindows="true">
<LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="16dp" android:paddingLeft="24dp" android:paddingRight="24dp">
<ImageView android:src="@drawable/kb_logo" android:layout_width="200dp" android:layout_height="200dp" android:layout_gravity="center" android:layout_marginBottom="10dp"
/>
<!--<RelativeLayout android:layout_width="fill_parent" android:layout_height="70dp" android:id="@+id/invalid_alert" android:visibility="gone"
android:background="@drawable/invalid_password">
<TextView
android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:textSize="12sp" android:textColor="#FF2146" android:layout_centerVertical="true" android:text="Invalid Email or Password!"
/>
</RelativeLayout>-->
<!-- ro lno Label -->
<android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:layout_marginBottom="8dp">
<EditText android:id="@+id/email"
android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Email" android:textColorHint="@color/colorPrimary"/>
</android.support.design.widget.TextInputLayout>
<!-- Name Label -->
<android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:layout_marginBottom="8dp">
<EditText android:id="@+id/password" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Password" android:inputType="textPassword" android:textColorHint="@color/colorPrimary"/>
</android.support.design.widget.TextInputLayout>
<android.support.v7.widget.AppCompatButton android:id="@+id/btn_login" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="24dp"
android:layout_marginBottom="24dp" android:padding="12dp" android:textSize="20sp"
android:shadowColor="@color/colorPrimaryDark" android:textStyle="bold" android:background="@color/colorPrimary" android:textColor="#ffffff"
android:text="Login"/>
<!-- <RelativeLayout android:layout_width="fill_parent" android:layout_height="50dp" android:id="@+id/signup_alert" android:clickable="true" android:layout_marginBottom="10dp" android:background="@drawable/sign_up_alert">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:textSize="15sp" android:textColor="#c6205609"
android:layout_centerVertical="true" android:text="Not a member? Sign Up now"
/>
</RelativeLayout>-->
</LinearLayout>
</ScrollView>
activity_main.xml
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
<LinearLayout
android:id="@+id/container_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical">
<include
android:id="@+id/toolbar" layout="@layout/toolbar" />
</LinearLayout>
<FrameLayout android:id="@+id/container_body" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1" />
</LinearLayout>
<fragment android:id="@+id/fragment_navigation_drawer"
android:name="info.androidhive.materialdesign.activity.FragmentDrawer" android:layout_width="@dimen/nav_drawer_width" android:layout_height="match_parent"
android:layout_gravity="start" app:layout="@layout/fragment_navigation_drawer" tools:layout="@layout/fragment_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>
Fragement_home.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:padding="0dp" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical"
tools:context="info.androidhive.materialdesign.activity.HomeFragment">
<!--1st row-->
<LinearLayout
android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#d2cece" android:weightSum="1.2" android:orientation="horizontal">
<RelativeLayout android:layout_width="wrap_content" android:layout_height="125dp" android:background="#FFB74D" android:id="@+id/receive_payments" android:layout_weight="0.6" >
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/receive_payments" android:id="@+id/a" android:layout_centerInParent="true"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/a"
android:layout_centerHorizontal="true" android:textStyle="bold" android:textColor="#ffffff" android:text="Receive Payments"/>
</RelativeLayout>
<RelativeLayout android:id="@+id/invoice_payments" android:layout_width="wrap_content" android:layout_height="125dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_weight="0.6" android:background="#81C784">
<ImageView android:id="@+id/b"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:src="@drawable/invoice_payments" />
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/b" android:layout_centerHorizontal="true" android:text="Invoice Payments" android:textColor="#ffffff" android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
<!--Seprator-->
<!--<LinearLayout android:layout_width="fill_parent" android:layout_height="1dp" android:background="#000000"/>-->
<!--2nd row-->
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"
android:weightSum="1.2" android:orientation="horizontal">
<RelativeLayout android:layout_width="wrap_content" android:layout_height="125dp" android:background="#E57373" android:id="@+id/spend_on_jobs" android:layout_weight="0.6" >
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/spend_on_job" android:id="@+id/c" android:layout_centerInParent="true"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/c" android:layout_centerHorizontal="true" android:textStyle="bold" android:textColor="#ffffff" android:text=" Spend Jobs "/>
</RelativeLayout>
<RelativeLayout android:layout_width="wrap_content" android:layout_height="125dp" android:background="#EC407A" android:id="@+id/spend_on_expenses" android:layout_weight="0.6">
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/spend_on_expenses" android:id="@+id/d" android:layout_centerInParent="true"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/d" android:layout_centerHorizontal="true" android:textStyle="bold" android:textColor="#ffffff" android:text="Spend Expense"/>
</RelativeLayout>
</LinearLayout>
<!--Seprator-->
<!--<LinearLayout android:layout_width="fill_parent" android:layout_height="1dp" android:background="#000000"/>-->
<!--3rdd row-->
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#000000" android:weightSum="1.2" android:orientation="horizontal">
<RelativeLayout android:layout_width="wrap_content" android:layout_height="125dp" android:layout_alignParentEnd="true" android:layout_alignParentRight="true"
android:layout_alignParentTop="true" android:layout_weight="0.6" android:background="#1565C0">
<ImageView
android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/receive_payments" android:id="@+id/e" android:layout_centerInParent="true"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/e" android:layout_centerHorizontal="true" android:textStyle="bold" android:textColor="#ffffff" android:textSize="12sp" android:text="Receive C/O Payments"/>
</RelativeLayout>
<RelativeLayout android:layout_width="wrap_content" android:layout_height="125dp"
android:background="#5C6BC0" android:layout_weight="0.6">
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@mipmap/ic_launcher" android:id="@+id/f" android:layout_centerInParent="true"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/f" android:layout_centerHorizontal="true" android:textStyle="bold" android:textColor="#ffffff" android:text="Receive Payments"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
fragment_navigation_drawer.xml
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white">
<RelativeLayout android:id="@+id/nav_header_container" android:layout_width="match_parent" android:layout_height="140dp" android:layout_alignParentTop="true" android:background="@color/colorPrimary">
<ImageView android:layout_width="70dp" android:layout_height="70dp" android:src="@drawable/ic_profile" android:scaleType="fitCenter" android:id="@+id/profile_pic"
android:layout_centerInParent="true" />
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/profile_pic" android:text="Welcome to KB Group" android:textColor="@android:color/white" android:textStyle="bold" android:layout_marginTop="5dp" android:layout_centerHorizontal="true"
/>
</RelativeLayout>
<android.support.v7.widget.RecyclerView android:id="@+id/drawerList" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/nav_header_container" android:layout_marginTop="5dp" />
</RelativeLayout>
nav_drawer_row.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:clickable="true">
<ImageView android:layout_width="25dp" android:layout_height="25dp" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:layout_centerVertical="true" android:layout_marginStart="5dp" android:layout_marginLeft="5dp" android:id="@+id/img"
/>
<TextView android:id="@+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:paddingLeft="10dp" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:layout_toRightO f="@+id/img" android:textColor="#000"
android:textSize="15sp" android:text="Hello"
/>
<View
android:layout_width="fill_parent" android:layout_height="0.5dp" android:background="#d2d2d2" android:layout_marginTop="30dp" android:layout_below="@id/title"/>
</RelativeLayout>
MainActivity.java
publicclassMainActivity extendsAppCompatActivity implements
FragmentDrawer.FragmentDrawerListener {
private staticString TAG= MainActivity.class.getSimpleName();
privateToolbar mToolbar ;
privateFragmentDrawer drawerFragment ; Context context;
@Override
protectedvoidonCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
Util util= newUtil(MainActivity.this); Log.e("UserId",""+util.getUser_ID());
mToolbar= (Toolbar) findViewById(R.id.toolbar); context=MainActivity.this; setSupportActionBar(mToolbar); getSupportActionBar().setDisplayShowHomeEnabled(true);
drawerFragment= (FragmentDrawer)
getSupportFragmentManager().findFragmentById(R.id.fragment_navigation_
drawer);
drawerFragment.setUp(R.id.fragment_navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout), mToolbar);
drawerFragment.setDrawerListener(this);
// display the first navigation drawer view on app launch
displayView(0);
}
@Override
publicbooleanonCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu. menu_main, menu);
return true;
}
@Override
publicbooleanonOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
intid = item.getItemId();
//noinspection SimplifiableIfStatement
if(id == R.id.action_settings) { Fragment fragment = null;
String title = getString(R.string.app_name); fragment = newSettings();
title = getString(R.string.title_settings);
FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction fragmentTransaction =
fragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.container_body, fragment); fragmentTransaction.commit();
// set the toolbar titlegetSupportActionBar().setTitle(title); return true;
}
returnsuper.onOptionsItemSelected(item);
}
@Override
public voidonDrawerItemSelected(View view, int position) { displayView(position);
}
privatevoiddisplayView(intposition) { Fragment fragment = null;
String title = getString(R.string.app_name);
switch(position) {
case0:
fragment = newHomeFragment(); title = getString(R.string.title_home);
break; case1:
fragment = newReceivePayments();
title = getString(R.string.title_add_child);
break; case2:
fragment = newInvoicePayments();
title = getString(R.string.title_my_childs);
break; case3:
fragment = newSettings();
title = getString(R.string.title_settings);
break; default:
break;
}
if(fragment != null) {
FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction fragmentTransaction =
fragmentManager.beginTransaction(); fragmentTransaction.addToBackStack(null); fragmentTransaction.replace(R.id.container_body, fragment); fragmentTransaction.commit();
// set the toolbar title
getSupportActionBar().setTitle(title);
}
}
@Override
protected voidonActivityResult(intrequestCode, intresultCode, Intent data) {
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.container_body);
fragment.onActivityResult(requestCode, resultCode, data);
}
}
activity_main.xml
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawe r_layout" android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical">
<LinearLayoutandroid:id="@+id/container_toolbar"
android:layout_width="match_parent"android:layout_height="wrap_content"android:orientation="vertical">
<include android:id="@+id/toolbar" layout="@layout/toolbar"/>
</LinearLayout>
<FrameLayout
android:id="@+id/container_body" android:layout_width="fill_parent"android:layout_height="0dp"android:layout_weight="1"/>
</LinearLayout>
<fragment android:id="@+id/fragment_navigation_drawer"
android:name="info.androidhive.materialdesign.activity.FragmentD rawe
r"
android:layout_width="@dimen/nav_drawer_width" android:layout_height="match_parent" android:layout_gravity="start" app:layout="@layout/fragment_navigation_drawer" tools:layout="@layout/fragment_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>
MyChilds.javapublic classMyChilds extendsFragment {
privateRecyclerView recyclerView ; privateChildAdapter mAdapter; ArrayList<String>
lst_id,lst_fname,lst_lname,lst_dob,lst_weight,lst_height,lst_sports; publicInvoicePayments() {
// Required empty public constructor
}
@Override
publicvoidonCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
publicView onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.invoice_payments, container,
false);
((AppCompatActivity)getActivity()).getSupportActionBar().setTitle("My Childs");
recyclerView= (RecyclerView)rootView.findViewById(R.id.recyclerView);
RecyclerView.LayoutManager mLayoutManager = new
LinearLayoutManager(getActivity()); recyclerView.setLayoutManager(mLayoutManager); recyclerView.setItemAnimator(newDefaultItemAnimator());
lst_id=newArrayList<String>();
lst_fname=newArrayList<String>();
lst_lname=newArrayList<String>(); lst_dob=newArrayList<String>(); lst_weight=newArrayList<String>(); lst_height=newArrayList<String>(); lst_sports=newArrayList<String>();
Login();
returnrootView;
}
@Override
public voidonAttach(Activity activity) {
super.onAttach(activity);
}
@Override
public voidonDetach() {
super.onDetach();
}
public voidLogin() {
String tag_json_obj = "json_obj_req";
finalProgressDialog progressDialog = new
ProgressDialog(getActivity()); progressDialog.setMessage("Loading..."); progressDialog.show();
finalHashMap<String, String> postParams = newHashMap<String, String>();
postParams.put("parent_id", "12");
finalRequestQueue requestQueue = Volley.newRequestQueue(getActivity());
JsonObjectRequest jsonObjReq = new
JsonObjectRequest(Request.Method.POST, Config.E, newJSONObject(postParams),
newcom.android.volley.Response.Listener<JSONObject>() {
@Override
publicvoidonResponse(JSONObject response) { Log.e("TAG", response.toString());
try {
JSONObject status=newJSONObject(response.toString());
if(status.getString("status").equals("true"))
{
progressDialog.dismiss();
JSONArray array= new
JSONArray(status.getJSONArray("data").toString());
Log.e("aa",""+array);
for(inti = 0; i < array.length(); ++i) { JSONObject rec = array.getJSONObject(i);
String id = rec.getString("id");
String fname = rec.getString("c_firstName"); String lname = rec.getString("c_lastName"); String dob = rec.getString("c_date_of_birth"); String weight = rec.getString("c_weight"); String height = rec.getString("c_height"); String sports = rec.getString("c_sports");
lst_fname.add(fname); lst_lname.add(lname); lst_dob.add(dob); lst_weight.add(weight); lst_height.add(height); lst_sports.add(sports); lst_id.add(id);
}
mAdapter = new
ChildAdapter(getActivity(), lst_id, lst_fname, lst_lname, lst_dob, lst_height, lst
_weight,lst_sports);
recyclerView.setAdapter(mAdapter);
}
else
{
progressDialog.dismiss();
String message=status.get("message").toString(); Toast.makeText(getActivity(), ""+message,
Toast.LENGTH_SHORT).show();
}
} catch(JSONException e) { Log.e("TAG", e.toString());
}
}
}, newcom.android.volley.Response.ErrorListener() {
@Override
publicvoidonErrorResponse(VolleyError error) {
//VolleyLog.d("TAG", "Error: " + error.getMessage());
}
}) {
@Override
publicString getBodyContentType() {
return "application/json; charset=utf-8";
}
@Override
publicMap<String, String> getHeaders() throwsAuthFailureError {
return super.getHeaders();
}
};
jsonObjReq.setRetryPolicy(newDefaultRetryPolicy(8000, 0, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
// Adding request to request queue
//AppController.getInstance().addToRequestQueue(jsonObjReq, tag_json_obj);
requestQueue.add(jsonObjReq);
}
}
API Code
<?php
function returnChildAgainstBottle($qr_code){ global $wpdb;
if(empty($qr_code)) return null;
$child_id = $wpdb->get_var("SELECT user_id from user_meta where meta_key = 'bottle_qr_code' AND meta_value = '{$qr_code}' order by user_id desc limit 1");
return ($child_id) ? $child_id : nu l;
}
function returnChildAgainstChildID($child_id){ global $wpdb;
if(empty($child_id)) return null;
key = 'c_lastName', meta_value, NULL)) AS 'c_lastName', GROUP_CONCAT(IF(meta_key = 'c_date_of_birth', meta_value,
NULL)) AS 'c_date_of_birth',
GROUP_CONCAT(IF(meta_key = 'c_gender', meta_value, NULL)) AS 'c_gender',
GROUP_CONCAT(IF(meta_key = 'c_height', meta_value, NULL)) AS 'c_height',
GROUP_CONCAT(IF(meta_key = 'c_weight', meta_value, NULL)) AS 'c_weight',
GROUP_CONCAT(IF(meta_key = 'bottle_qr_code', meta_value, NULL)) AS 'bottle_qr_code'
FROM user_meta WHERE `user_id` = {$child_id};"); return ($child) ? $child : nu l;
}
function returChildAge ($date) { global $wpdb; if(empty($date)) return nu l;
$date = new DateTime($date);
$now = new DateTime();
$interval = $now->diff($date);
return ($interval->y) ? $interval->y : nu l;
}
function returnGlassO fWaterByChildWeight($weight){ global $wpdb;
if(empty($weight)) return nu l;
$first_half = 10;
$second_half = 10;
$third_half = $weight - ($first_half + $second_half);
$form = (100 * $first_half) + (50 * $second_half) + (20 * $third_half); return round($form / 250);
}
function returnlastLogByChild($child_id, $qr_code, $c_weight = null){ global $wpdb;
if(empty($child_id) || empty($qr_code)) return false;
$last_status = $wpdb->get_row("SELECT * FROM `score_log` WHERE child_id = {$child_id} AND `bottle_code` = '{$qr_code}' AND DATE(`insert_time`) = CURDATE() ORDER BY id desc limit 1");
if(!$last_status){
$insert_status = $wpdb->insert('score_log', array('child_id' => $child_id, 'bottle_code' => $qr_code, 'bottle_refill' => 0, 'to_drink' => returnGlassO fWaterByChildWeight($c_weight), 'to_pee' => returnGlassO fWaterByChildWeight($c_weight) / 1.5, 'insert_time' => date('Y- m-d h:m:s')));
if(!$insert_status) return false;
$last_status = $wpdb->get_row("SELECT * FROM `score_log` WHERE child_id = {$child_id} AND `bottle_code` = '{$qr_code}' AND id = {$wpdb-
>insert_id} AND DATE(`insert_time`) = CURDATE() ORDER BY id desc limit 1");
}
return ($last_status) ? $last_status : false;
}
function returnWaterStatsByLogid($log_id){ global $wpdb;
if(empty($log_id)) return false;
$logs_meta = $wpdb->get_results("SELECT `water_status`, `insert_time` FROM `water_meta_log` WHERE log_id = {$log_id};");
return ($logs_meta) ? $logs_meta : false;
}
function generateWaterReminderMsg($percentage){
$msg = nu l;
if($percentage > 100) $msg = "Amazing! You achieved more than goal!"; else if($percentage == 100) $msg = "Excellent! You achieved your goal for
today!";
else if($percentage < 100 && $percentage > 90) $msg = "Keep going! you are getting there!";
else if($percentage < 90 && $percentage > 80) $msg = "Keep drinking! you can do it!";
else if($percentage < 80 && $percentage > 50) $msg = "Keep drinking! you are half way there!";
else if($percentage < 50 && $percentage > 40) $msg = "You need to drink more, drink!";
else if($percentage < 30 && $percentage > 20) $msg = "Seems like you are low on water today, drink!";
else if($percentage < 20) $msg = "Hey Pal, drink more, you have to go a long way!";
else $msg = "Drink more and get to your goal for today!"; return $msg;
}
function generatePeeReminderMsg($percentage){
$msg = nu l;
if($percentage > 100) $msg = "Amazing! You achieved more than goal!"; else if($percentage == 100) $msg = "Excellent! You achieved your goal for
today!";
else if($percentage < 100 && $percentage > 90) $msg = "Keep going! you are getting there!";
else if($percentage < 90 && $percentage > 80) $msg = "You need to pee to stay healthy! you can do it!";
else if($percentage < 80 && $percentage > 50) $msg = "You need to pee to stay healthy! you are half way there!";
else if($percentage < 50 && $percentage > 40) $msg = "You need to urinate more, go!";
else if($percentage < 30 && $percentage > 20) $msg = "Seems like you are low on pee today, go!";
else if($percentage < 20) $msg = "Hey Pal, pee more, you have to go a long way!";
else $msg = "Pee more and get to your goal for today!"; return $msg;
}
$app->get('/droppee/bottle/update_water_status/', 'updateWaterStatus'); function updateWaterStatus($request, $returned, $args) {
global $wpdb;
// $start_memory = memory_get_usage();
$response = returnErrorResponse();
$timestamp = date('Y-m-d h:m:s'); if(empty($_GET['qr_code'])) return $returned-
>write(wp_json_encode(array('st' => false, 'err' => true, 'msg' => 'qr_code_not_set' , 'data' => array())));
$qr_code = $_GET['qr_code'];
$child_id = returnChildAgainstBottle($qr_code);
if(empty($child_id)) return $returned->write(wp_json_encode(array('st' => false, 'err' => true, 'msg' => 'no_child_found')));
if($_GET['status'] == '') return $returned->write(wp_json_encode(array('st'
=> false, 'error' => true, 'msg' => 'status_not_set' , 'data' => array())));
$bottle_status = ($_GET['status'] == 'empty') ? 0 : $_GET['status'];
$child = returnChildAgainstChildID($child_id);
if(!$child) return $returned->write(wp_json_encode(array('status' => false, 'error' => true, 'msg' => 'child' , 'data' => array())));
$last_log = returnlastLogByChild($child_id, $qr_code, $child->c_weight); if(!$last_log) return $returned->write(wp_json_encode(array('error' =>
'last_log')));
$get_previous_meta_log = $wpdb->get_results("SELECT * FROM
`water_meta_log` WHERE `log_id` = {$last_log->id};"); if($get_previous_meta_log){
$get_last_meta_log = end($get_previous_meta_log); if($get_last_meta_log->water_status == 0){
// _die("bottle empty"); if((int)$bottle_status > 0){
// _die($last_log->bottle_refill);
$last_log->bottle_refill += 1;
}
}
}
$add_stat_meta = $wpdb->insert('water_meta_log', array('log_id' =>
$last_log->id, 'water_status' => $bottle_status * $last_log->bottle_refill, 'insert_time' => $timestamp));
if(!$add_stat_meta) return $returned->write(wp_json_encode(array('error'
=> 'add_stat_meta')));
$meta_logs = returnWaterStatsByLogid($last_log->id);
if(!$meta_logs) return $returned->write(wp_json_encode(array('error' => 'meta_logs')));
$consumed_glasses = 0;
$temp1 = 0;
$temp2 = 0;
$last_key = 0;
$water_goal_achieved_per = number_format(($consumed_glasses /
$last_log->to_drink) * 100, 0);
$update_log = $wpdb->update('score_log', array('bottle_refill' => $last_log-
>bottle_refill, 'consumed' => $consumed_glasses, 'water_per' =>
$water_goal_achieved_per, 'update_time' => $timestamp), array('id' =>
$last_log->id));
if(!$update_log) return $returned->write(wp_json_encode(array('error' => 'update_log')));
$water_msg = generateWaterReminderMsg(round($water_goal_achieved_per));
$water_msg_insert_log = $wpdb->insert('reminder_log', array('log_id' =>
$last_log->id, 'water_msg' => $water_msg, 'pee_msg' => "")); if(!$water_msg_insert_log) return $returned-
>write(wp_json_encode(array('error' => 'update_log')));
$pee_score = $last_log->urinated . '-' . $last_log->to_pee;
$pee_goal_achieved_per = $last_log->urine_per;
$pee_msg = generatePeeReminderMsg(round($pee_goal_achieved_per));
$response = array("st" => true, "err" => false, "msg" => "pass", "name" =>
$child->c_firstName . ' ' . $child->c_lastName, "ws" => $water_score, "ps" =>
$pee_score, "wper" => $water_goal_achieved_per. '%', "wm" => $water_msg, "pper" => $pee_goal_achieved_per. '%', "pm" => $pee_msg);
// echo memory_get_usage() - $start_memory;
return $returned->write(wp_json_encode($response));
}
<?php
$app->post('/droppee/child/add/', 'insertChild'); function insertChild($request, $returned, $args) {
global $wpdb;
$response = returnErrorResponse();
$parameter = json_decode($request->getBody());
$emptyCheck = checkEmptyObject($parameter, array('c_firstName', 'c_lastName', 'c_parent_id', 'c_gender', 'c_date_of_birth', 'c_height', 'c_weight', 'bottle_qr_code'));
if($emptyCheck['status'] != true) return $returned-
>write(wp_json_encode(returnErrorResponse(1)));
$dataToSave_one = array(
'registration_timestamp' => date('Y-m-d h:m:s'), 'role_id' => (3),
'active' => '1');
// _die($parameter, true);
$results = $wpdb->insert('users', $dataToSave_one); if ($results) {
$lastID = $wpdb->insert_id;
if($parameter->c_sports) $parameter->c_sports = maybe_serialize($parameter->c_sports);
addUserMeta($lastID, 'c_firstName', $parameter->c_firstName); addUserMeta($lastID, 'c_lastName', $parameter->c_lastName); addUserMeta($lastID, 'c_parent_id', $parameter->c_parent_id); addUserMeta($lastID, 'c_gender', $parameter->c_gender); addUserMeta($lastID, 'c_date_of_birth', $parameter->c_date_of_birth); addUserMeta($lastID, 'c_height', $parameter->c_height); addUserMeta($lastID, 'c_weight', $parameter->c_weight); addUserMeta($lastID, 'bottle_qr_code', $parameter->bottle_qr_code); addUserMeta($lastID, 'c_sports', $parameter->c_sports);
$wpdb->show_errors();
if (!$wpdb->last_error) $response = array('status' => true, 'error' => false, 'message' => 'account_created', 'data' => array());
}
return $returned->write(wp_json_encode($response));
}
$app->post('/droppee/child/get/by_id/', 'getChildDataByID'); function getChildDataByID($request, $returned, $args) {
global $wpdb;
$response = returnErrorResponse();
$parameter = json_decode($request->getBody());
if(empty($parameter->child_id)) return $returned-
>write(wp_json_encode(returnErrorResponse(1)));
$keys = array('c_firstName', 'c_lastName', 'c_date_of_birth', 'c_gender', 'c_height', 'c_weight');
if($parameter->keys) $keys = array_filter($parameter->keys); if(!$keys) return $returned-
>write(wp_json_encode(returnErrorResponse()));
$query = "SELECT u.id, u.`email`, u.`active`";
foreach ($keys as $k) $query .= ", GROUP_CONCAT(IF(um.meta_key = '{$k}', um.meta_value, NULL)) AS '{$k}'";
$query .= " FROM users u INNER JOIN `user_meta` um ON u.`id` = um.`user_id` WHERE u.`role_id` = 3 AND u.`id` = {$parameter->child_id};";
$results = $wpdb->get_row($query);
if($results) $response = array('status' => true, 'error' => false, 'message' => 'success', 'data' => $results);
return $returned->write(wp_json_encode($response));
}
$app->post('/droppee/child/edit/', 'editChild'); function editChild($request, $returned, $args) {
global $wpdb;
$response = returnErrorResponse();
$parameter = json_decode($request->getBody());
$emptyCheck = checkEmptyObject($parameter, array('child_id', 'c_firstName', 'c_lastName'));
if($emptyCheck['status'] != true) return $returned-
>write(wp_json_encode(returnErrorResponse(1)));
$editID = $parameter->child_id;
$wpdb->show_errors();
if(!empty($parameter->c_firstName)) updateUserMeta($editID, 'c_firstName', $parameter->c_firstName);
if(!empty($parameter->c_lastName)) updateUserMeta($editID, 'c_lastName', $parameter->c_lastName);
if(!empty($parameter->c_parent_id)) updateUserMeta($editID, 'c_parent_id', $parameter->c_parent_id);
if(!empty($parameter->c_parent_id)) updateUserMeta($editID, 'c_gender',
$parameter->c_gender);
if(!empty($parameter->c_date_of_birth)) updateUserMeta($editID, 'c_date_of_birth', $parameter->c_date_of_birth);
if(!empty($parameter->c_height)) updateUserMeta($editID, 'c_height',
$parameter->c_height);
if(!empty($parameter->c_weight)) updateUserMeta($editID, 'c_weight',
$parameter->c_weight);
if(!empty($parameter->bottle_qr_code)) updateUserMeta($editID, 'bottle_qr_code', $parameter->bottle_qr_code);
if(!empty($parameter->c_sports)) updateUserMeta($editID, 'c_sports', maybe_serialize($parameter->c_sports));
updateUserMeta($editID, 'last_update', date('Y-m-d h:m:s'));
if (!$wpdb->last_error) $response = array('status' => true, 'error' => false, 'message' => 'account_modified', 'data' => array());
return $returned->write(wp_json_encode($response));
}
$app->post('/droppee/child/delete/by_id/', 'deleteChildByID'); function deleteChildByID($request, $returned, $args) {
global $wpdb;
$response = returnErrorResponse();
$parameter = json_decode($request->getBody()); if(empty($parameter->child_id)) return $returned-
>write(wp_json_encode(returnErrorResponse(1)));
$results = $wpdb->delete( 'users', array('id' => $parameter->child_id, 'role_id' => 3));
if($results) $results_meta = $wpdb->delete( 'user_meta', array('user_id' =>
$parameter->child_id));
if($results_meta) $response = array('status' => true, 'error' => false, 'message' => 'delete_success', 'data' => array());
return $returned->write(wp_json_encode($response));
}
$app->get('/droppee/child/get/score/by_id/', 'getChildScoreByID');
function getChildScoreByID($request, $returned, $args) { global $wpdb;
{$_GET['child_id']} ORDER BY id desc limit 1";
$results = $wpdb->get_row($query);
if($results) $response = array('status' => true, 'error' => false, 'message' => 'success', 'data' => $results);
return $returned->write(wp_json_encode($response));
}
$app->post('/droppee/parent/add/', 'insertParent'); function insertParent($request, $returned, $args) {
global $wpdb;
$response = returnErrorResponse();
$parameter = json_decode($request->getBody());
$emptyCheck = checkEmptyObject($parameter, array('p_firstName', 'p_lastName', 'p_email', 'p_password', 'p_phone', 'p_phone_last_mac_address'));
if($emptyCheck['status'] != true) return $returned-
>write(wp_json_encode(returnErrorResponse(1))); if(!checkExistingEmail($parameter->p_email)) return $returned-
>write(wp_json_encode(returnErrorResponse(2)));
$last_ip = returnIP();
$hashedPassword = password_hash($parameter->p_password, PASSWORD_DEFAULT, ['cost' => 9]);
$dataToSave_one = array(
'username' => sanitize_text_field($parameter->p_email), 'password' => sanitize_text_field($hashedPassword), 'email' => sanitize_text_field($parameter->p_email), 'registration_timestamp' => date('Y-m-d h:m:s'),
'role_id' => (2),
'active' => '1');
$dataFormat = array('%s','%s','%s','%s','%s','%s');
$results = $wpdb->insert('users', $dataToSave_one, $dataFormat); if ($results) {
$lastID = $wpdb->insert_id;
$dataToSave_two = array(
'p_firstName' => sanitize_text_field($parameter-
>p_firstName),
'p_lastName' => sanitize_text_field($parameter-
>p_lastName),
'p_phone' => sanitize_text_field($parameter->p_phone), 'p_phone_last_mac_address' => sanitize_text_field($parameter-
>p_phone_last_mac_address),
'last_ip' => $last_ip, 'last_update' => NULL,
'last_login_ip' => NULL, 'p_tries' => NULL, 'p_hacked' => NULL,
'p_dout' => NULL,
'p_ip' => NULL,
'p_hash' => NULL,
'p_sesid' => NULL);
$responseArray = array();
foreach ($dataToSave_two as $key => $value) $responseArray[$key][]
= addUserMeta($lastID, $key, $value);
$response = array('status' => true, 'error' => false, 'message' => 'account_created', 'data' => array());
}
return $returned->write(wp_json_encode($response));
} $app->post('/droppee/parent/logout/', 'logOut'); function logOut($request, $returned, $args){
global $wpdb;
$response = returnErrorResponse(); session_unset();
session_destroy(); setcookie("cookLoggedInTime", "", time()-3600);
$response = array('status' => true, 'error' => false, 'message' => 'logged_out_success', 'data' => array());
return $returned->write(wp_json_encode($response));
}
$app->post('/droppee/parent/get/by_id/', 'getParentDataByID'); function getParentDataByID($request, $returned, $args) {
global $wpdb;
$response = returnErrorResponse();
$parameter = json_decode($request->getBody()); if(empty($parameter->parent_id)) return $returned-
>write(wp_json_encode(returnErrorResponse(1)));
$keys = array('p_firstName', 'p_lastName', 'p_phone', 'p_phone_last_mac_address', 'last_update');
if($parameter->keys) $keys = array_filter($parameter->keys); if(!$keys) return $returned-
>write(wp_json_encode(returnErrorResponse()));
$query = "SELECT u.id, u.`email`, u.`active`";
foreach ($keys as $k) $query .= ", GROUP_CONCAT(IF(um.meta_key
= '{$k}', um.meta_value, NULL)) AS '{$k}'";
$query .= " FROM users u INNER JOIN `user_meta` um ON u.`id` = um.`user_id` WHERE u.`role_id` = 2 AND u.`id` = {$parameter-
>parent_id};";
$results = $wpdb->get_row($query);
if($results) $response = array('status' => true, 'error' => false, 'message'
=> 'success', 'data' => $results);
return $returned->write(wp_json_encode($response));
}
Arduino Code:
#include <SPI.h> // f.k. for Arduino-1.5.2
#include <SD.h> // Use the official SD library on hardware pins #include <Adafruit_GFX.h> // Hardware-specific library
#include <MCUFRIEND_kbv.h> #include <UTFTGLUE.h>
//https://github.com/ivanseidel/UTFT/blob/master/examples/Arduino%20(AR M)/UTFT_ViewFont/UTFT_ViewFont.ino
UTFTGLUE myGLCD(0x9163, A2, A1, A3, A4, A0); //arguments are ignored
extern uint8_t SmallFont[]; //font size : small extern uint8_t BigFont[]; //font size : big
extern uint8_t SevenSegNumFont[]; //font style void wifi_init();
void showIP();
uint8_t showBMP(char *, int, int); void sendData(String); MCUFRIEND_kbv tft;
//color codes
#define BLACK 0x0000
#define BLUE 0x001F #define RED 0xF800 #define GREEN 0x07E0 #define CYAN 0x07FF
#define MAGENTA 0xF81F #define YELLOW 0xFFE0 #define WHITE 0xFFFF #define flag 0
void setCursor(uint16_t x0, uint16_t y0); void setTextColor(uint16_t color);
void setTextColor(uint16_t color, uint16_t backgroundcolor); void setTextSize(uint8_t size);
void setTextWrap(boolean w); void fillScreen(uint16_t color); void displayText(String text); #define rotationConstant 1
#if defined(ESP32)
#define
SD_CS
53
#else
#define
SD_CS
53
#endif
#define NAMEMATCH "" // "" matches any name
#define PALETTEDEPTH 0 // do not support Palette modes
uint8_t ret;
String server = ""; //variable for sending data to webpage String bottleStatus = "";
boolean No_IP = false; //variable to check for ip AddreSerial2 String IP = ""; //variable to store ip AddreSerial2
char temp1 = '0'; String ch;
char Arraymsg [90];
char Arrayconfig [90]; String myFile = "";
byte sensorPin[] = {30, 28, 26, 24, 22}; //pins for water indicating sensors const byte sensors = 5; //number of sensors
int a = 0;
int level = 0; int Config;
String thisString = ""; int i = 0;
char namebuf[32] = "/"; //BMP files in root directory
char *name1
= "/frame_1.bmp";
//BMP images
in root directory
char *name2
= "/frame_2.bmp";
//BMP images
in root directory
char *name3
= "/frame_3.bmp";
//BMP images
in root directory
char *name4
= "/frame_4.bmp";
//BMP images
in root directory
char *name5
= "/frame_5.bmp";
//BMP images
in root directory
char *name7 = "/frame_6.bmp"; //BMP images in root directory char *name6 = "/info.txt"; //profile text file
File root; int pathlen;
void startSDCard(){
bool good = SD.begin(SD_CS); if (!good) {
Serial.print(F("SD CARD PATH ERROR!"));
tft.setRotation(rotationConstant); myGLCD.fillRoundRect(25, 65, 220, 190);
myGLCD.setColor(255, 0, 0);
myGLCD.setBackColor(255, 0, 0);
myGLCD.print("SD CARD PATH ERROR!", CENTER, 80);
displayText("oho");
if(!good) good = true; //breaking loop while (1);
}
delay(2000);
root = SD.open(namebuf); pathlen = strlen(namebuf);
}
void displayText(String text){
myGLCD.clrScr(); tft.setRotation(rotationConstant);
// myGLCD.setBackColor(VGA_WHITE);
// myGLCD.setColor(VGA_GREEN); myGLCD.setBackColor(255, 255, 255);
myGLCD.setColor(0, 128, 0); myGLCD.setFont(BigFont); myGLCD.setFont(SevenSegNumFont); myGLCD.print(text, CENTER, 3);
}
void setup(){ uint16_t ID; Serial.begin(9600);
Serial1.begin(9600); ID = tft.readID();
// Serial.println(ID, HEX);
if (ID == 0x0D3D3) ID = 0x9481;
tft.begin(ID); tft.fillScreen(0x001F); tft.setTextColor(0xFFFF, 0x0000);
myGLCD.InitLCD(PORTRAIT); //800x480 is already wider than tall.
myGLCD.setFont(SmallFont); pinMode(22, INPUT_PULLUP); pinMode(24, INPUT_PULLUP); pinMode(26, INPUT_PULLUP); pinMode(28, INPUT_PULLUP); pinMode(30, INPUT_PULLUP);
// startSDCard(); wifi_init(); // starting wifi
showIP(); // showing connected ip
// Serial.println("Bottle Ready..");
}
int checkBottleStatus(){ level = 0;
bool statusFlag = false;
// Serial.println("********start********"); for(int i = 0; i < sensors; i++) { if(!statusFlag){
int digitalReadVal = digitalRead(sensorPin[i]); if(digitalReadVal == LOW) {
/*Serial.println(" - - - - Pin Number------ ");
Serial.println(sensorPin[i]); Serial.println("Digital Read:"); Serial.println(digitalReadVal);
level = sensors - i;
Serial.println("Low Condition, iteration Number:");
Serial.println(i);*/ level = sensorPin[i]; statusFlag = true;
}
}
}
// Serial.println("********end********"); Serial.println("**LEVEL**"); Serial.println(level);
delay(50); return level;
}
void loop(){
level = checkBottleStatus(); bottleStatus = "";
switch(level){ case 30:
bottleStatus = "1000 ml"; Serial.println("");
break; case 28:
bottleStatus = "800 ml"; Serial.println("800"); break;
case 26:
bottleStatus = "600 ml"; Serial.println("600"); break;
case 24:
bottleStatus = "400 ml"; Serial.println("400"); break;
case 22:
bottleStatus = "200 ml"; Serial.println("200"); break;
default:
bottleStatus = "Empty Bottle"; Serial.println("Empty Bottle"); break;
}
while (a == 0) { myGLCD.clrScr();
tft.setRotation(rotationConstant); myGLCD.setColor(255, 0, 0);
myGLCD.fillRect(0, 0, 319, 13);
myGLCD.setColor(64, 64, 64);
myGLCD.setColor(255, 255, 255);
myGLCD.setBackColor(255, 0, 0);
myGLCD.print("DROPPEE", CENTER, 3);
myGLCD.setBackColor(64, 64, 64);
myGLCD.setColor(255, 255, 0);
myGLCD.print("FYP", CENTER, 300);
myGLCD.fillRoundRect(25, 65, 220, 190);
myGLCD.setColor(255, 0, 0);
myGLCD.setBackColor(255, 0, 0); myGLCD.print("Wifi is Connected", CENTER, 80);
myGLCD.print("ENABLING SD CARD...", CENTER, 119);
myGLCD.print("Checking Water Level...", CENTER, 155); a = 4;
//delay (10000);
}
if (Serial1.available()){
ch = Serial1.readString();
}
ch.toCharArray(Arraymsg, 90);
/*
for (int i = 0; i<=2; i++) { Aarrayconfig[i] = Arraymsg[i+11];
} */ Serial.println(Arraymsg[11]); char bmp = Arraymsg[11]; ch = " ";
Arraymsg[11] = 'z'; Serial.println(Arraymsg[11]); switch(bmp){
case 'a': Serial.println("IMAGE 1");
showBMP(name1, 5, 5); bmp = 'z';
break; case 'b':
Serial.println("IMAGE 2");
showBMP(name2, 5, 5); bmp = 'z';
break; case 'c':
Serial.println("IMAGE 3");
showBMP(name3, 5, 5);
bmp = 'z'; break; case 'd':
Serial.println("IMAGE 4");
showBMP(name4, 5, 5); bmp = 'z';
break; case 'e':
Serial.println("IMAGE 5");
showBMP(name5, 5, 5); bmp = 'z';
break; case 'f':
Serial.println("IMAGE 6");
showBMP(name7, 5, 5); bmp = 'z';
break; case 'g':
server = "IP: "; server += IP;
server += "Bottle STATUS: "; server += bottleStatus; sendData(server);
delay(500); bmp = 'z';
ch = " "; delay(100); break; case 'h':
showIP(); delay(100); break; case 'i':
wifi_init(); delay(100); break; case 'j':
displayText("you owe me!"); delay(100);
break; case 'x':
// re-open the file for reading: root = SD.open("info.txt"); if (root) {
int i = 0; int file[60];
myFile = "";
// read from the file until there's nothing else in it: while (root.available()) {
for (int s = 0; s <= 47; s++){ file[s] = (root.read());
}
for (int cc = 0; cc <= 47; cc++) { myFile += char(file[cc]);
}
}
root.close(); // close the file:
}
else { // if the file didn't open, print an error: Serial.println("error opening info.txt");
}
//////////////////////////////////////// server = "Student Info: "; server += myFile; sendData(server); delay(500);
///////////////////////////////////////// myGLCD.clrScr(); tft.setRotation(rotationConstant);
tft.fillScreen(BLACK); tft.setTextWrap(true); tft.setTextColor(RED); tft.setTextSize(60); myGLCD.print(myFile, CENTER, 135); bmp = 'z';
ch = " "; delay(100); break; default:
//wrong input
myGLCD.print("Wrong Input", CENTER, 155); break;
}
}
#define BMPIMAGEOFFSET 54
#define BUFFPIXEL 20 uint16_t read16(File& f) {
uint16_t result; // read little-endian f.read((uint8_t*)&result, sizeof(result)); return result;
}
uint32_t read32(File& f) {
uint32_t result;
f.read((uint8_t*)&result, sizeof(result)); return result;
}
uint8_t showBMP(char *nm, int x, int y){ tft.fillScreen(0);
tft.setRotation(4); File bmpFile;
int bmpWidth, bmpHeight; // W+H in pixels
uint8_t bmpDepth; // Bit depth (currently must be 24, 16, 8, 4, 1) uint32_t bmpImageoffset; // Start of image data in file
uint32_t rowSize; // Not always = bmpWidth; may have padding uint8_t sdbuffer[3 * BUFFPIXEL]; // pixel in buffer (R+G+B per pixel) uint16_t lcdbuffer[(1 << PALETTEDEPTH) + BUFFPIXEL], *palette = NULL;
uint8_t bitmask, bitshift;
boolean flip = true; // BMP is stored bottom-to-top
int w, h, row, col, lcdbufsiz = (1 << PALETTEDEPTH) + BUFFPIXEL, buffidx;
uint32_t pos; // seek position boolean is565 = false; //
uint16_t bmpID;
uint16_t n; // blocks read
uint8_t ret;
if ((x >= tft.width()) || (y >= tft.height())) return 1; // off screen Serial.print("UDF: ");
Serial.println(nm);
bmpFile = SD.open(nm); // Parse BMP header bmpID = read16(bmpFile); // BMP signature (void) read32(bmpFile); // Read & ignore file size
(void) read32(bmpFile); // Read & ignore creator bytes bmpImageoffset = read32(bmpFile); // Start of image data (void) read32(bmpFile); // Read & ignore DIB header size bmpWidth = read32(bmpFile);
bmpHeight = read32(bmpFile);
n = read16(bmpFile); // # planes -- must be '1' bmpDepth = read16(bmpFile); // bits per pixel
pos = read32(bmpFile); // format if (bmpID != 0x4D42) ret = 2; // bad ID
else if (n != 1) ret = 3; // too many planes
else if (pos != 0 && pos != 3) ret = 4; // format: 0 = uncompressed, 3 = 565 else if (bmpDepth < 16 && bmpDepth > PALETTEDEPTH) ret = 5; // palette
else {
bool first = true;
is565 = (pos == 3); // ?already in 16-bit format
// BMP rows are padded (if needed) to 4-byte boundary rowSize = (bmpWidth * bmpDepth / 8 + 3) & ~3;
if (bmpHeight < 0) { // If negative, image is in top-down order. bmpHeight = -bmpHeight;
flip = false;
}
w = bmpWidth; h = bmpHeight;
if ((x + w) >= tft.width()) // Crop area to be loaded w = tft.width() - x;
if ((y + h) >= tft.height()) // h = tft.height() - y;
if (bmpDepth <= PALETTEDEPTH) { // these modes have separate palette
bmpFile.seek(BMPIMAGEOFFSET); //palette is always @ 54 bitmask = 0xFF;
if (bmpDepth < 8) bitmask >>= bmpDepth; bitshift = 8 - bmpDepth; n = 1 << bmpDepth; lcdbufsiz -= n;
palette = lcdbuffer + lcdbufsiz;
for (col = 0; col < n; col++) {
pos = read32(bmpFile); //map palette to 5-6-5
palette[col] = ((pos & 0x0000F8) >> 3) | ((pos & 0x00FC00) >> 5) | ((pos & 0xF80000) >> 8);
}
}
// Set TFT address window to clipped image bounds tft.setAddrWindow(x, y, x + w - 1, y + h - 1);
for (row = 0; row < h; row++) { // For each scanline...
// Seek to start of scan line. It might seem labor-
// intensive to be doing this on every line, but this
// method covers a lot of gritty details like cropping
// and scanline padding. Also, the seek only takes
// place if the file position actua ly needs to change
// (avoids a lot of cluster math in SD library). uint8_t r, g, b, *sdptr;
int lcdidx, lcdleft;
if (flip) // Bitmap is stored bottom-to-top order (normal BMP) pos = bmpImageoffset + (bmpHeight - 1 - row) * rowSize;
else // Bitmap is stored top-to-bottom pos = bmpImageoffset + row * rowSize;
if (bmpFile.position() != pos) { // Need seek? bmpFile.seek(pos);
buffidx = sizeof(sdbuffer); // Force buffer reload
}
for (col = 0; col < w; ) { //pixels in row lcdleft = w - col;
if (lcdleft > lcdbufsiz) lcdleft = lcdbufsiz;
for (lcdidx = 0; lcdidx < lcdleft; lcdidx++) { // buffer at a time uint16_t color;
// Time to read more pixel data?
if (buffidx >= sizeof(sdbuffer)) { // Indeed bmpFile.read(sdbuffer, sizeof(sdbuffer)); buffidx = 0; // Set index to beginning
r = 0;
}
switch (bmpDepth) { // Convert pixel from BMP to TFT format case 24:
b = sdbuffer[buffidx++]; g = sdbuffer[buffidx++]; r = sdbuffer[buffidx++];
color = tft.color565(r, g, b); break;
case 16:
b = sdbuffer[buffidx++]; r = sdbuffer[buffidx++];
if (is565)
color = (r << 8) | (b); else
color = (r << 9) | ((b & 0xE0) << 1) | (b & 0x1F); break;
case 1:
case 4:
case 8:
if (r == 0)
b = sdbuffer[buffidx++], r = 8;
color = palette[(b >> bitshift) & bitmask]; r -= bmpDepth;
b <<= bmpDepth; break;
}
lcdbuffer[lcdidx] = color;
}
tft.pushColors(lcdbuffer, lcdidx, first); first = false;
col += lcdidx;
} // end cols
} // end rows
tft.setAddrWindow(0, 0, tft.width() - 1, tft.height() - 1); //restore fu lscreen
ret = 0; // good render
}
bmpFile.close(); switch (ret) { case 0:
// Serial.print(millis() - start); Serial.println(F("ms")); delay(5000);
break; case 1:
Serial.println(F("bad position")); break;
case 2:
Serial.println(F("bad BMP ID")); break;
case 3:
Serial.println(F("wrong number of planes")); break;
case 4:
Serial.println(F("unsupported BMP format")); break;
case 5:
Serial.println(F("unsupported palette"));
break; default:
Serial.println(F("unknown")); break;
}
}
/////////////////// ESP 8266 //////////////////////
//check for the availability of IP AddreSerial2 void findIp(int time1) {
int time2 = millis();
while (time2 + time1 > millis()){ while (Serial1.available() > 0) {
if (Serial1.find("IP has been read")){ No_IP = true;
}
}
}
}
//Display the IP AddreSerial2 void showIP(){
IP = "";
char ch = 0; while (1) {
Serial1.println("AT+CIFSR"); while (Serial1.available() > 0){ if (Serial1.find("STAIP,")){
delay(1000); Serial.print("IP Address:");
while (Serial1.available() > 0){ ch = Serial1.read();
if (ch == '+') break;
IP += ch;
}
}
if (ch == '+') break;
}
if (ch == '+') break; delay(1000);
}
Serial.print(IP); Serial.print("Port:"); Serial.println(80);
//////////////////////////////TFT DISPLAY///////////////////////////////////
tft.setRotation(rotationConstant); myGLCD.fillScr(0, 0, 255);
myGLCD.setColor(255, 0, 0);
myGLCD.fillRoundRect(25, 65, 220, 190);
myGLCD.setColor(255, 255, 255);
myGLCD.setBackColor(255, 0, 0); myGLCD.print("IP ADDRESS: ", CENTER, 93); myGLCD.print(IP, CENTER, 119);
myGLCD.print("Droppee", CENTER, 160);
myGLCD.setColor(0, 255, 0);
myGLCD.setBackColor(0, 0, 255); myGLCD.print("PORT: ", CENTER, 290); myGLCD.print("80", CENTER, 300);
delay(5000);
}
//Define the proceSerial2 for sending AT Serial1ands to module void establishConnection(String Serial1and, int timeOut){
int q = 0; while (1){
Serial.println(Serial1and); Serial1.println(Serial1and);
/////////////////////TFT DISPLAY/////////////// tft.setRotation(rotationConstant);
myGLCD.fillScr(0, 0, 255);
myGLCD.setColor(255, 0, 0);
myGLCD.fillRoundRect(25, 65, 220, 190);
myGLCD.setColor(255, 255, 255);
myGLCD.setBackColor(255, 0, 0);
myGLCD.print("Connecting....", CENTER, 93);
myGLCD.print(Serial1and, CENTER, 119);
myGLCD.print("Droppee", CENTER, 160);
myGLCD.setColor(0, 255, 0);
myGLCD.setBackColor(0, 0, 255); myGLCD.print("Runtime: (mS)", CENTER, 290); myGLCD.printN umI(timeO ut, CENTER, 300); while (Serial1.available()){
if (Serial1.find("OK "))
// Clear the screen and draw the frame q = 8;
}
delay(timeO ut); if (q > 5) break;
q++;
}
if (q == 8) {
Serial.println("OK ");
}
else { Serial.println("Error");
tft.setRotation(rotationConstant); myGLCD.fillRoundRect(25, 65, 220, 190);
myGLCD.setColor(255, 0, 0);
myGLCD.setBackColor(255, 0, 0);
myGLCD.print("AT ERROR, PLEASE RESTART THE MODULE", CENTER, 80);
while (1);
}
}
//send AT Serial1ands to module void wifi_init() { establishConnection("AT", 100);
establishConnection("AT+CWMODE=3", 100);
establishConnection("AT+CWQAP", 100);
// establishConnection("AT+CIOBAUD=9600", 2000);
//establishConnection("AT+RST",5000); findIp(5000);
if (!No_IP){ Serial.println("Connecting Wifi. ");
establishConnection("AT+CWJAP=\"ItHurtsWhenPassword\",\"36674242\"", 7000); //provide your WiFi username and paSerial2word here
}
Serial.println("Wifi Connected");
// showIP(); establishConnection("AT+CIPMUX=1", 5000);
establishConnection("AT+CIPSERVER=1,80", 7000);
}
//send data to module
void sendData(String server1){ int p = 0;
while (1){
unsigned int l = server1.length(); Serial1.print("AT+CIPSEN D=0,"); Serial1.println(l + 2);
delay(100); Serial.println(server1); Serial1.println(server1); while (Serial1.available()){ if (Serial1.find("OK ")){
p = 11;
break;
}
}
if (p == 11) break; delay(100);
}
}
[1] Tanner (October 19, 2017)
[2] Huang, MD, FAAP (Nov 25, 2016)
[3] Jenkins (August 14, 2017)
[4] Crew (January, 14, 2016)
[5] Berger (September 8, 2015)
[6] Gongala (April 5, 2017)
[7] Ferry Jr.MD(October 21,2016)
[8] Jornay (March 11, 2017)
[9] Marcin MD (June 26, 2017)
[10] P. Greenfield (April 24, 2017)
[11] Nuhospitals (January 6, 2016)
[12] JS, Duggan C (October1 9, 2017)
[13] Remedies (July 11, 2015)
[14] “Oral rehydration therapy” (November 13, 2016)
[15] J. Steiner, MD (September 16, 2016)
[16] A. DeWalt, MD, MPH (May 7, 2015)
[17] William (April 4, 2015)
[18] S. Byerley (June 2, 2016)
[19] Colin Tidy (23 Apr, 2014)
[20] Linthicum (December 5, 2015)
[21] Louis (August 9, 2016)
[22] Clinton, (May 5, 2016)
[23] Elsevier (July 15, 2017)
[24] H Huang, Corden, (November 27, 2016)
[25] Clan (November 21, 2015)
[26] Alizey (December 3, 2016)
[27] Fam Physician (October 1, 2016)
[28] Suson (January 5, 2016)
[29] Caselli (September 19, 2015)
[30] Jacquelyn (December 8, 2016)
[31] William (October 6, 2015)
[32] Johansan (May 7, 2017)
[33] Blvd (February 24, 2017)
[34] Nickel (September 26, 2015)
[35] Gheen, APRN (June 19, 2016)
[36] Ghulam (September 5, 2015)
[37] Shreeram S et al.(January 4, 2016)
[38] Grandjean (August 2, 2016)
[39] Evans (September 11, 2017)
[40] Pattison (December 5, 2015)
[41] Derbyshire (March 3, 2017)
[42] Marley, (January 3, 2017)
[43] Balentine (May 25, 2015)
[44] Marcin MD (June 26, 2017)
[45] Gandy, Dietitian (March 5, 2017)
[46] Jovanov (December 27, 2015)
[47] “Moikit - Sports Bottle Revolutionized” (May 19, 2017)
[48] “Trago” (June 21, 2016)
[49] “Hydra - Smart Bottle” (August 11, 2016)
[50] “H2Opal” (December 4, 2015)
[51] “Broking lab” (May 6,2017)
[52] “Sportline” (September 15, 2015)
[53] “Thermos” (June 4 2015)
[54] “PYRUS” (April 18, 2016)
[55] “Slomg” (October 16, 2017)
[56] “Hidrate Spark” (August 29, 2017)
[57] “Crooked Brains” (January 25. 2015)
[58] Holdings (January 30, 2017)
[59] Jovanov et al.(September 9, 2015)
[60] DeMeyer (December 8, 2017)
[61] Louisiana (August 21, 2015)
[62] “Ultrasonic Level Sensors” (July 13, 2017)
[63] Ametherm (May 9, 2015)
[64] Herbert (November 24, 2017)
[65] Syzdek L.A (November 25, 2017)
Frequently asked questions
What is the purpose of this document?
This is a comprehensive language preview that includes the title, table of contents, objectives and key themes, chapter summaries, and keywords of a project named "Droppee".
What is Droppee about?
Droppee is a smart bottle system designed to encourage children to drink more water and urinate at the right time, using a smart watch application and a game for motivation.
What are the key components of the Droppee system?
The system consists of a smart bottle, a smart watch application, and a mobile application for parents.
What are the key features of the smart bottle?
The smart bottle includes features such as water intake tracking, an OLED display, a leveling sensor, and the ability to prompt the child to drink water and urinate. It also integrates a game to motivate the child.
What are the features of the smart watch application?
The smart watch application allows for manual input of urination activity tracking and displays information such as the child's name, number of glasses to drink, and notification messages.
What are the features of the mobile application for parents?
The mobile application allows parents to track their child's water intake and urine activity, monitor fitness data, manually notify children, and share statistics with doctors.
What is the main problem that Droppee aims to solve?
Droppee aims to address the problem of children avoiding drinking enough water and holding urine, which can lead to health issues like dehydration and urinary infections.
What are the limitations of Droppee?
The limitations include the need for an internet connection to sync data, careful handling of the bottle, and the requirement for manual input of urine activity.
What technologies are used in the Droppee project?
The project utilizes technologies such as Android Studio, Java, PHP, Slim Framework, Arduino IDE, C++, and GIMP.
What are the potential health problems associated with not drinking water and holding urine?
Not drinking enough water can lead to dehydration and various diseases, while holding urine can cause kidney stones, cystitis, and bladder swelling.
What are some similar products that are currently available?
Similar products include Moikit smart bottle, Trago smart bottle, Hydra Smart Bottle, H2Opal Smart bottle, Ozmo Smart Bottle, Sportline HydraCoach Intelligent Water Bottle, Thermos 24 Ounce Hydration Bottle, Drink Water Reminder PYRUS, Fruit Water Infusion Bottle, Hidrate Spark, and Blufit Water Bottle.
What is the scope of the project?
The scope includes lowering the rate of diseases due to lack of water, motivating kids to drink more water, inducing the child to urinate, and providing parents a solution for tracking.
How does the game in the smart bottle work?
The game involves a flower character that grows as the child drinks water, with prompts to urinate to provide the character with fertilizers.
What algorithm is used for calculating water intake needs?
The formula is (100 ml for each of the first 10 kg) + (50 ml for each kg 11 - 20) + (20 ml for each additional kg) / 24 hours.
What formula used for Calculating Urination needs?
Number of times to urinate = Number of total glasses to drink / 1.5.
What did the literature review cover?
The literature review covered the problems that come with urine retention and dehydration, and other similar products for tracking fluids.
What did the bibliography include?
The bibliography included resources from websites, research papers, and medical publications. It also referred to personal communication with doctors to gather patient data.
What is included in the appendix?
The appendix contains information including the entity relationship diagram, use cases, process flow diagram, class diagram, data flow diagram, circuit diagram, test cases, the graphical user interface and the application code.
- Quote paper
- shaheryar shahid (Author), 2018, Droppee. Smart water bottle and urine tracker, Munich, GRIN Verlag, https://www.grin.com/document/506895