Home Store Project Ideas Project Guide Ask An Expert Blog Careers Teachers Parents Students

Staying Healthy with Personal Medicine Apps

Difficulty
Time Required Average (6-10 days)
Prerequisites None
Material Availability This project requires the use of a computer with Internet access (preferably wireless). See the Materials and Equipment list for details.
Cost Very Low (under $20)
Safety No issues

Abstract

The benefits of Western medicine have evolved tremendously, with a wealth of tests and medications to treat many conditions. But remembering to take medication or perform a test regularly, consistently, and at specific times can be difficult for elderly people with short-term memory loss, or teenagers absorbed in activities. With mobile devices becoming our constant companions, could a smartphone or tablet offer a solution?

The Massachusetts Institute of Technology (MIT) has created a simple tool making it possible to create a reminder app for anyone who has a computer and Internet access. It is easy, quick, and powerful. In this project, you will build a medicine-reminder app that employs a phone or tablet to remind its user to take action. It is up to you to customize the app and make it work for the user(s) of your choice.

Objective

Use MIT App Inventor to create a personalized medicine-reminder app.

Credits

Sabine De Brabandere, PhD, Science Buddies

Cite This Page

MLA Style

Science Buddies Staff. "Staying Healthy with Personal Medicine Apps" Science Buddies. Science Buddies, 21 Aug. 2014. Web. 23 Nov. 2014 <http://www.sciencebuddies.org/science-fair-projects/project_ideas/HumBio_p041.shtml>

APA Style

Science Buddies Staff. (2014, August 21). Staying Healthy with Personal Medicine Apps. Retrieved November 23, 2014 from http://www.sciencebuddies.org/science-fair-projects/project_ideas/HumBio_p041.shtml

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.


Last edit date: 2014-08-21

Introduction

Tired of hearing comments about the downside of electronic devices? What about an app that could help you manage your health? The Massachusetts Institute of Technology (MIT) has developed programming language enabling anyone to create an app on a computer with Internet access. And you don't need a computer programming background. In this science project, you will build a medicine-reminder app. Once you get comfortable with the program, you can build many more apps that facilitate a healthier lifestyle. Only your imagination sets the limit!

Being young and healthy, you might wonder why people would need a reminder to take their medicines. But the truth is many elderly and chronically ill people have several medications to take, each on a different schedule. This is an increasing problem as the population of elderly adults rises in many countries. Data gathered by researchers (see the chapter by Marek and Antle in the Bibliography) suggests that inability to take the right medications at the right time and at the right dose is one of the major reasons an elderly person enters a nursing home. Researchers also conclude that improperly taking medications is the cause of a significant percentage of hospitalizations for elderly patients. The medicine box shown in Figure 1, below, shows how difficult it can be to keep track of all the medications that patients on multiple medications need to take.

Medicine reminder boxes can help patients keep track of all the medications they need to take
Figure 1. Medicine reminder boxes, with compartments for various days and times, can help patients keep track of all the medications they need to take.

Why is it such a big deal if someone does not take their medications as prescribed? Let's zoom into a couple of cases and explore the consequences of not following prescribed medical treatment. For diabetic patients, it is essential to check insulin levels several times a day, as frequent low insulin levels can lead to nerve damage, damaged eyesight, and kidney damage, among a host of other ailments. High blood pressure or high cholesterol levels are other examples that, if not treated regularly, can drastically reduce life expectancy. On the other hand, low blood pressure can put the patient in instant danger, because falls can occur when blood pressure drops below a threshold. While this is bad enough for the patient, not taking medications as directed also puts the wider population at risk. For example, a patient who doesn't follow the prescribed times and doses of antibiotic treatments can increase exposure to others of the number of drug-resistant germs. The resulting infections are difficult to treat. In short, a medicine reminder could help increase the quality of life of patients, shorten illnesses, reduce doctor visits or hospital stays, and reduce the need for more expensive (and toxic) medications.

Convinced? Before you start building a medicine-reminder app, let's see what an app is and what it can do.

App is the abbreviation for application software. It refers to a self-contained computer program designed to run on a mobile device like a smartphone or tablet. As the use of mobile devices has exploded, it has created a new field of science called mobile computing. It focuses on human-computer interactions with mobile devices. Creating apps is a big part of mobile computing.

You may already be familiar with a variety of apps. To name a few possibilities, apps can be programmed to be aware of the location of the device's user, send and receive text messages, give directions to a destination, connect to the Internet, and much more. You might notice that apps can be divided into two main categories: ones that entertain (like games) and ones that fulfill a human need (like informing you where the closest recycling center is). In this computer science project, your challenge is to build an app with App Inventor that reminds an individual to take medications or check blood pressure or blood-sugar level.

App Inventor is MIT's programming language to create apps for Google's Android mobile devices. Android is a type of mobile operating system popular on many smartphones and tablets (its main counterpart is Apple's iOS). The settings of your device can inform you which operating system your device uses. App Inventor apps only run on Android devices. You do not need an Android device to create an app with App Inventor. You can use any computer to create and the emulator to test your app. The user of the app, on the other hand, will need to have an Android device to run the app.

Before you start coding, you need to have an idea of how your app will work and what it is supposed to do. Computer software engineers call this set of descriptions the user requirements. Do you have an idea what the user requirements of your medicine reminder app will be? Imagine being your intended user. What would you want from a medicine reminder app, and how can your app fill this need?

To get quick results, you will use an incremental approach to build and refine your app. The Procedure of this computer science project will guide you through building the core of your app. You can then pursue several rounds of improvements or changes with the medicine reminder app you have envisioned.

Finally, always keep the user in mind as you build your app. Think of who, how, and when the user will use the app. The better it fits their needs and lifestyle, the more successful your app will be.

Terms and Concepts

  • App
  • Mobile computing
  • App Inventor
  • Android
  • User requirements
  • Behavior
  • User interface
  • Variables
  • List
  • Executable
  • Source

Questions

  • If you ask a patient what a medicine reminder could do for him/her, what do you think he/she will answer?
  • How would you translate this need into a user requirement for your app?
  • Is it important to have a good idea of where and when the patient will use the app before you start building it? If so, why and where in the design process would you use this information?

Bibliography

News Feed on This Topic

 
, ,
Reading level:
Note: A computerized matching algorithm suggests the above articles. It's not as smart as you are, and it may occasionally give humorous, ridiculous, or even annoying results! Learn more about the News Feed

Materials and Equipment

  • Computer with access to the Internet.
    • For more information on system requirements, please visit Setting up App Inventor 2. Scroll down to the end of the page to find the system requirements.
  • (Optional): Volunteer(s) taking medicine or check blood pressure or blood-sugar level on a regular schedule who could test your app.

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.

Experimental Procedure

Note: This engineering project is best described by the engineering design process, as opposed to the scientific method. You might want to ask your teacher whether it's acceptable to follow the engineering design process for your project before you begin. You can learn more about the engineering design process in the Science Buddies Engineering Design Process Guide.

Getting Started

Before you embark on building your medicine reminder app, you need to perform a couple of small tasks: First set up your computer and Android device or emulator and then work through a couple of tutorial apps to become familiar with App Inventor 2. This section will walk you through the tasks.

  1. Follow the instructions listed on this App Inventor setup page to prep your computer and Android device or emulator to use the App Inventor.
  2. Have a quick look at the Designer and Blocks Editor overview page.
  3. Now, use the introductory TalkToMe text-to-speech app project available from the Beginner Video Tutorials page to build the TalkToMe app. You will learn:
    1. How to create a new project;
    2. How to connect your computer with your device;
    3. How to use the design mode to design your app;
    4. How to use the block mode to add functionality;
    5. How to code a button; and
    6. How to use the text-to-speech block.

    Note that what an app does is often referred to as its behavior in computer language. The blocks editor is where you code the behavior of your app. The user Interface is specified in the design mode.

  4. Before you build your next app, save your project using the Save project command found in the Project drop-down menu, as shown in Figure 2, below.
The <i>'Project'</i> drop down menu allows to save a project, so you can come back to it at a later time.
Figure 2. The Project drop-down menu enables you to save a project, so you can come back to it at a later time.
  1. Use the extended TalkToMe project available from the same page to learn some more basic programming skills like :
    1. How to open and alter an existing project;
    2. How to ask information from the user and store it in a variable; and
    3. How to use variables.

    As a programmer, you will frequently want your program to "remember" information like a value, a word, or a sentence. For example, if your program requests information from the user, or if it calculates a value, you will want to remember it somewhere so you can use it later. The way your program remembers things is by storing them in variables. So in essence, variables are placeholders; they can hold information and be overwritten by new information. Before you can use a variable in a program, it needs an initial value. In this project, the user provides the initial value by typing in text.

    You will probably finish these two projects in less than an hour!

  2. You can save this project under a different name using the Save project as ... command found in the Project drop-down, as shown in Figure 2, above.
  3. Before we embark on your own project, create the Magic 8-ball app. This will help you get more comfortable with MIT App Inventor and teach you:
    1. How to build and use a list; and
    2. How to package your app, so it stays on your phone when you disconnect from the Internet.

    A list is a tool that can be used to store multiple pieces of information at once. You can see it as an ordered series of variables. They are used to store related data. As you learn to program, you will soon realize lists are commonly used and very handy.

Set the User Requirements for the Core App

  1. You will now start specifying the core of your medicine reminder app. First, decide on the best means to provide information to the user you have in mind.

    This procedure will use spoken messages to communicate with the user. Although this might be appropriate for an elderly person, it might not be appreciated by a student sitting in a classroom or socializing with friends. With your target user in mind, what do you think is the best way to communicate? Some options are listed below. Note you can use combinations of these, but in no way should you feel limited to this list. You can use any means of communication that you feel appropriate:

    1. Spoken message
    2. Vibrating phone (only for cell phones)
    3. Displayed message
    4. Displayed picture

    Adapt the procedure below to reflect your choice.

  2. Set the user requirements.

    The core app will:

    1. display a welcome sentence or welcome image on the screen so the user knows it is running;
    2. provide one reminder message each day, at the hard-coded time of 2 p.m. (Note: This simple approach will let you gain familiarity with MIT App Inventor. Once you have done that, you can expand your app to do other things, let the user customize the reminder time, or add multiple reminders per day. There are more suggestions in the Enhancing Your App section, below.);
    3. give reminder messages even when the app is running in the background.
    4. make the reminder a spoken message such as "It is now 2 p.m.; please take your medication." You can change this specification to reflect your choice selected in step 1.

Build the Core App

  1. Get a jump start.
    1. Open the TalkToMe text-to-speech app you made in the Getting Started section.
    2. Use the Save project as ... function to save it under a different name. This will prevent overwriting your TalkToMe text-to-speech app.
  2. Create a welcome message.
    1. Change the app so it displays a message and/or image when running. Note you can use the Label or Image component to do this. Click the "?" next to a component (as shown in Figure 3, below) if you are curious about it. App Inventor will display a short description and a link to a more detailed description. It is a quick way to explore possibilities.
Clicking on the question mark next to the component will display a short description and a link to a more detailed description of the component.
Figure 3. Clicking on the question mark next to the component will display a short description and a link to a more detailed description of the component.
  1. Select a clock.

    If you had to keep track of the time, you would not constantly stare at your watch, waiting for it to reach exactly 2 p.m., would you? That would be very inefficient — it's difficult to do other things while you are watching a clock. Instead, you would probably look down at your watch occasionally to check the time. You will program your app to do something similar using a timer. App Inventor provides a timer as part of the Clock component. This timer goes off at regular intervals specified in the TimeInterval property of the Clock. With a timer, you can let your app check the time at regular intervals. Whenever the timer goes off, your app jumps to the Clock.Timer event where you can specify what your app needs to do in case the timer fires. How to do this will be explained in step 4, below. In this step, you will create the Clock component and set the properties of the associated timer.

    1. Drag a Clock component from the list of user interface components in the designer mode palette to you viewer. Note the clock will appear as non-visible component under your screen. Figure 4, below, can help you find the Clock component.
    2. How often would you like your app to create a timer event? Or, how often does the timer need to go off? You can specify this in the Clock.TimeInterval property of the clock as shown in Figure 5, below. Note the number in the TimeInterval property needs to be expressed in milliseconds. There are 1000 milliseconds in a second.
    3. Set the TimeInterval property to 1 minute, or 60,000 milliseconds. If you wish to, you can change the TimeInterval property when you start enhancing your app (see the Enhancing Your App section below).
    4. Ensure the timer is enabled and fires even when the focus is not on the screen and the app runs in the background. You can do this by checking the checkboxes in the Clock property window as can be seen in Figure 5.
The <i> Clock</i> component of App Inventor can be found under the <i>User Interface</i> list in the Designer Mode pallet
Figure 4. The Clock component can be found under the User Interface list in the designer mode palette.

The interval between consecutive <i>Clock</i> events can be specified in the properties section of the <i>Clock</i> component
Figure 5. The interval between consecutive Clock events can be specified in the properties section of the Clock component. Note the number is specified in milliseconds.
  1. Code the timer event.

    Though you have just created the clock with timer, you still need to tell the app what to do when the timer goes off.

    1. Because you want to code a behavior, you will navigate to the Block mode.
    2. Select the Clock. A list of associated blocks for Clock-specific behaviors will appear as shown in Figure 6, below.
    3. Drag the When Clock.Timer do ... block to the Blocks viewer. The app will execute the list of blocks clicked in the "do" field every time the timer fires.
Selecting the <i> Clock</i> component in the Block mode allows to drag the <i> When Clock.Timer do...</i> block to the Blocks viewer.
Figure 6. Selecting the Clock component in the Block mode enables you to drag the When Clock.Timer do ... block to the Blocks viewer. You specify what the app should do each time the timer fires in the "do" field.
  1. Check the time.

    You just used a Clock to create a timer. A second use of the Clock component is to manipulate time and express time in various units. The internal time format is called an instant. The clock's Now block (Clock.Now) visible in Figure 7, below gives the current time as an instant. The Clock component provides blocks to manipulate instants, for example, to show the second, minute, hour, or day of a given instant. An example of how combining clock blocks allows easy access to the current hour is shown in Figure 8, below. This particular combination of blocks will show the current hour as a number from 0 (midnight) to 23 (11 pm).

    1. Use Clock blocks to note the current time in a user-friendly format. Figure 8 below can help you do this.
    2. Use the TextToSpeech block to let your app give the hour as a spoken message. Note you can click the whole combination shown in Figure 8, below, into the TextToSpeech block or use an intermediate variable. The Join text block can help you frame the output in a sentence.
    3. As an option, can you do the same or add the minutes to the message?
    4. Run your app and verify
      1. if the time in the spoken message is correct and
      2. if the interval between timed events is what you thought it should be.
    5. Make adjustments where needed.
    6. You can remove the TextToSpeech block(s) once you are sure you have set the clock accurately.
The <i>Now</i> block of the <i>Clock</i>  indicated on this figure returns the current <i>instant</i> in internal time format.
Figure 7. The Now block of the Clock indicated on this figure gives the current instant in internal time format. Other Clock blocks shown on this figure give easy access to the minute, month, and second of an instant. .

Combining <i>Clock</i> blocks allow easy access to the hour of the current time as a number from 0 to 23 (midnight till 11pm).
Figure 8. Combining Clock blocks enable easy readability of the current hour as a number from 0 to 23 (midnight till 11 p.m.).
  1. Add a feature known as "logic checking" to verify that the correct time to send out a reminder has been reached.
    1. Select Control and Logic blocks in the Design mode, as shown in Figure 9, below.
    2. Start by coding a logical test in the Block mode that verifies if the specified time has been reached. In other words, the logical test should read "TRUE" whenever the specified time of 2 p.m. has been reached and "FALSE" in all other cases. If you need help on logical test blocks, try the logic blocks documentation of App Inventor.
    3. Click the logic test you just coded in a control block to direct the app to specific code that will be executed only when a reminder should be sent.
      1. Can you figure out how to use the if ... then block on your own? If you need help, visit the Control Blocks manual of App Inventor. Note: Click the blue square before the "if" in the block displayed in Figure 9 to display additional options available for the if ... then sequence.
<i>Control</i> blocks are used in App Inventor to direct the app.
Figure 9. Control blocks are used to direct the app.
  1. Code the reminder message.
    1. Add code so the app sends the reminder message as specified in the user requirements.
  2. Save your current version.
    1. It is a good habit to frequently save your work.
  3. Test your app.
    1. Test your app in all the possible scenarios you can think of.
    2. Look for loopholes. For example, make sure your message is not repeated several times between 2 p.m. and 3 p.m. Introducing a variable that keeps track of whether the message has been sent out that day (reset this variable to 0 at midnight) is one way to solve this.
    3. Make changes where needed.
    4. Make sure to retest all scenarios after you have implemented changes.

General note: The method presented above is just one way of coding your medicine reminder app. You may discover totally different ways of writing the code that work just as well, or even better! Can you explore App Inventor and come up with a different way to write the program?

Enhancing Your App

This completes a first version of your medicine reminder app. You can now let your imagination run wild. What improvements would you like to implement? If you can, talk to your target users, show them your current app, and listen carefully to their feedback. This will guide you in making improvements that have the biggest impact.

  1. Some improvements you might consider are listed below.
    1. You can change the TimeInterval property of the clock. How do you think this will affect your medicine reminder? Can you find a good tradeoff between accuracy (sending out your reminder at 2 p.m. sharp) and processor use (frequent checking of the time)?
    2. Implement a button to confirm that users have taken the medication or performed a medical test. Repeat the reminder message every 15 minutes until the user confirms by clicking the button.
    3. Let users specify the time they need to take medical action. As an added functionality, you can prompt previous choice(s) each time users open the app. Hint: You might want to look into the TinyDB component of App Inventor if you like to store user choices.
    4. Enable the app to handle multiple reminders each day for different medications or actions.
    5. Let users enter and/or change the text of the reminder message they hear or upload the picture they see.
    6. When users are reminded to perform a test (like measuring blood pressure or glucose levels), ask them to enter their measurement. The app can then store it in a database for historical comparisons and/or create recommendations for the amount of medication to take, send an alert text message to a nurse if levels are above a specified level, etc.
  2. Each improvement iteration should consist of the following steps:
    1. Specify the change or improvement.
    2. Make the changes.
    3. Test your new app.

    The following page will help you understand the Engineering Design Process.

  3. Consult the Bibliography to find additional links to MIT App Inventor tutorials and libraries. They can be a great source of inspiration and help.

Package and Share Your App

Decide on how you would like to share your app:

  • You can share your app in an executable form, which means it can be run on a computer. This executable can then be installed and run on other Android devices.
  • You can also share the source code (the text listing of commands for an executable program or app) so other people can load it into App Inventor on their computer, open the project under their account, and work on changes if they wish to.
  • There is also an option to distribute your app on the Google Play Store.
  • The directions on sharing and packaging apps will guide you through the process.
  • Show us what you made! We would love to see what problems your app solves and we may even feature it in a future blog post!

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.


Variations

  • Can you find other medical uses of apps? Here are some examples to get your imagination going:
    • An app that tracks your allergy symptoms so you can map it against the historical pollen index for your area and find out what exactly you are allergic to.
    • As a reminder to take action, you can create an app that displays a Web page with the UV index or allergy information on the phone.
  • For a more challenging project, can your app provide a warning whenever a heat alert is in effect for your region? You can use an API (application programming interface) to retrieve information like weather alerts from sites on the Web supporting APIs. The Weather API designer is just one of them. You will need to ask for an "API key," which then provides a unique URL that you can point your program to for accessing the information supported by the site.
  • Create a game for a phone or tablet that increases awareness of health-related issues or prompts users to live a more healthy lifestyle.
  • Create an app that checks on users and sends a distress text message to an emergency contact. This could be useful for an elderly person living alone or a person going on an adventure. The app could ask at a preset time if you are still OK. If left unanswered, the app could then send a distress message including GPS location to one or a list of emergency contacts. Hints: Locations can be retrieved using the LocationSensor component listed under the Sensor components in the Palette; a text message can be set up using the texting component listed under the social components.
  • Can you create phone apps for other areas in life where one could be useful, like increasing environmental awareness, apps helping researchers collect data, or apps enhancing your social life?

Share your story with Science Buddies!

I did this project I Did This Project! Please log in and let us know how things went.

Ask an Expert

The Ask an Expert Forum is intended to be a place where students can go to find answers to science questions that they have been unable to find using other resources. If you have specific questions about your science fair project or science fair, our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Ask an Expert

Related Links

If you like this project, you might enjoy exploring these related careers:

Health educators at wellness fair

Health Educator

Have you ever heard the expression "Prevention is the best medicine"? Prevention is the fundamental work of all health educators. They attempt to prevent illnesses or diseases in individuals or entire communities through education about nutrition, exercise, or other habits and behaviors. Health educators present scientific information in ways that their audience can relate to, and are sensitive to cultural differences. They are the cornerstone of the public health system, improving health and saving thousands of lives by motivating changes in behavior. Read more
NASA flight software engineer

Computer Software Engineer

Are you interested in developing cool video game software for computers? Would you like to learn how to make software run faster and more reliably on different kinds of computers and operating systems? Do you like to apply your computer science skills to solve problems? If so, then you might be interested in the career of a computer software engineer. Read more
Computer programmer typing on a keyboard

Computer Programmer

Computers are essential tools in the modern world, handling everything from traffic control, car welding, movie animation, shipping, aircraft design, and social networking to book publishing, business management, music mixing, health care, agriculture, and online shopping. Computer programmers are the people who write the instructions that tell computers what to do. Read more
female technical writer working

Technical Writer

Have you tried to install new video-game software or connect a new printer to your computer? Doing something like this can be a little scary because of concerns about what may happen to your computer if you don't do it properly. So you read the instructions pamphlet that came with the software or printer and follow it step by step. Thankfully, the instructions are clear and you are successful with the installation! You can credit a technical writer for creating those helpful directions that guided you to success. The technical writer's task is to prepare documents, like user manuals and instructions, that communicate technical information about a computer or other complex product to a target audience in a clear and concise manner. Another way to think of a technical writer is as a person whose job it is to make our use of complicated devices a little easier and less frustrating. Read more

News Feed on This Topic

 
, ,
Reading level:
Note: A computerized matching algorithm suggests the above articles. It's not as smart as you are, and it may occasionally give humorous, ridiculous, or even annoying results! Learn more about the News Feed

Looking for more science fun?

Try one of our science activities for quick, anytime science explorations. The perfect thing to liven up a rainy day, school vacation, or moment of boredom.

Find an Activity