A big thank you to MIT APP Inventor without whom I would not have been able to achieve this small personal project.
I created a GPS tracking application because I will be leaving for a year with my camper van. I'll be using an old, permanently plugged-in phone for this tracker. The tracker will allow me to, I hope, find my vehicle if it is stolen. It will also allow my family to know where I am live. Finally, I would have the layout of my entire journey through Europe and America.
To do this, the application sends the GPS coordinates to a MySql database with the GET method and a bit of PHP. The sending is done at regular intervals configurable in the app (60 seconds by default).
Everything works fine ... except when the screen is off. There the sending is no longer done at regular intervals. Where the sending must be done every 10s for the test, there is a send after several minutes.
Is it possible, that screen off, the sending interval is not disturbed ??
I have lifted the data and battery consumption restrictions for the app.
for this purpose there exists an extension you might want to use...
alternatively you will have to keep the screen on to keep the application alive...
one method to do this is to use the KeepScreenOn method from the tools extension App Inventor Extensions: Tools | Pura Vida Apps but this will drain the battery faster...
If the device falls into Doze mode, all possible functions (CPU, WiFi / Network connection, GPS, timer, ...) are throttled / shut down. To prevent Doze, a Foreground service is required.
If using the Background Tasks extension does not work for you, then you will need to run your app with screen on all the time, or as a foreground service. There are, to my knowledge, no available extensions to allow you to do this.
That said, see here:
Also, please stop necro-posting every topic you can find about running in the background.
It is an etiquette, we didn't create such rules...
Create a new post instead, and if the moderatos have to merge it to old topic, then in that specific topic only you can necropost.
so what is your expectation for a solution?
If you can figure out your own solution, then why not post it here for others to learn? there would be no need for an extension.
and if we already figured out a solution, we would have made a guide about it ages ago ...