Keep the app open in the background

I have created an application to manage the daily intake of a medication, I use a website to manage the intake of medication.

I would like to send a notification every day at noon if the medication has not been taken.
But I have a problem: I don't know how to keep the app open in the background 24 hours a day and have it start automatically.

Thank you for your help.

Read all of this, see if it will work for you:

or also consider this:

Hello Steftony

Welcome to the community :slight_smile:

Why are you using a website for such an important task? There will always be the possibility of the site becoming unavailable, e.g. server issue, or a broadband failure, or a WiFi failure.

I would recommend making your App self-contained, independent of the internet.

How do you know, if the medication has not been taken?


Of course he can't. So it can only be an additional reminder.

This is what the OP said


Well, he's wrong about that. Who can know what someone did in their (supposed) privacy? Unless there are illegal surveillance methods. (And who reallly believes in such a thing? :wink:)

1 Like

This is your assumption
You do not know how that website works...

For example probably there is a login to identify a user and a checkbox for each day which can be clicked if the medication has been taken...
Etc... etc...


1 Like

Basically everything is possible, but how likely is that if you put yourself in this situation? Who would behave like this? I most likely wouldn't do that.


found at Inspirational Motivational Quote `your only Limit is Your Mind.` on Green Leaf Background. Stock Photo - Image of peace, inspirational: 170976424


I want to go through the site because I know more about websites and because on the site I can track from any device when the medication has been taken or not.

I use a database and if the website is unavailable, so is the database.

But I don't know if it's better for me to do it all on the app without going through the website.

I'd like to go through the website database, and check via an SQL command whether or not the medication was taken today.

In short, I'd like to be able to check every day at noon whether the medication has been taken, and send a notification if it hasn't been taken.

  1. Connect the database directly with the app, see fot example App Inventor Tutorials and Examples: MySQL | Pura Vida Apps

  2. Write a procedure, which checks the database, use the notification style extension to send the notification and get it running in the foreground first

  1. Try the itoo extension, read the complete thread and try the examples to learn how the extension works
  1. Get it running in the background. For questions about itoo ask in the itoo thread and provide a screenshot of what you tried


What does a website's database have to do with asking if someone took their medication? To what extent and where could there be a connection?

However, if I were asked to save the intake of a medication in a central database, I would know for sure that I would be in the wrong place there.

You have seen the concerns of @ChrisWard and @Anke ...

Your app could be implemented locally without any Internet access

To store the data you could use TinyDB or as you are familiar with SQL you also could use access SQlite you have to use an extension, for example this one



Dear @Steftony,
I don't know whether you are a European citizen, but anyway, please be aware that whenever you "record" in any way: digital or written on paper, data that are identifying univocally a European citizen you MUST comply with the European law EU679/2016 GDPR (General Data Protection Regulation).
This means that your app must grant that no unadvertent loss nor voluntary data theft can happen. This implies that you shall implement measures to guarantee pseudonymity and/or anonymity of the users whose personal data are stored into your database. This is strongly applicable since you store also data regarding their health and phone numbers.
I say that not to scare you, but because I've been the responsible for the cybersecurity (CISO) and privacy (DPO) for a multinational company, whose plants are spread worldwide, for many years and I've faced (read: fighted !) a lot with such matters. So, before spending time on technical aspects, please be sure that your app and the related database will be compliant with the Privacy laws (almost every country has one equivalent to the GDPR: PIPL in China, CCPA In USA-California; FLPPDHPP in Mexico..... ). The law states that whoever treats personal data must grant "privacy by design and by default": this leads to split personal data into several encryped databases, whose composing algorithm is known only by you; if other persons are aware of it, they shall be legally binded to you: as "the data controller". Additional means like overall data cyptography, multi-layered passwords, encryped-back-ups shall apply as well. A real nightmare for those (like me) who aren't a lawyer !!!

In a nutshell: be careful.... :thinking: and best wishes... :crossed_fingers: