kept application active despite the screen off

Hello,

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.

Thank you for your help

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...

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

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.

Ok thank you. I will use keepscreenon so :).

Have fun

did you find a solution for your problem

Read posts #2 to #4!

I did not understand

As I told you in your other topic:

https://community.appinventor.mit.edu/t/storage-data-using-app-inventor/55091/5

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.

2 Likes