I have the device that is in wifi communication with ESP8266 so that it can log certain values. I would like to know if and how the ESP8266, due to some changes in the values read, can call this app even if the device has the display turned off and / or if I'm viewing another app
You need to do two things to keep your app running in the background:
1. Create a foreground service (not the starter service).
2. Acquire a partial lock with PhoneWakeState.