Run script only when the screen is off

0
Speak, I'm trying to automate phone routines with an app I've made and to make it more effective I'm trying to implement a script so it runs whenever the phone's screen is turned off. For example: if the screen is off > run the script, make all updates + run antivirus + other functions that the user chooses to automate. If anyone can give me a light, I'm grateful.

    
asked by anonymous 16.04.2018 / 15:07

1 answer

1

When it comes to device routine: detect shutdown mode. On android, for example, we have the:

Intent.ACTION_SCREEN_OFF and ACTION_SCREEN_ON

  

You will not get anything ONLY with javascript ...

Study what is listed below to be able to follow a javascript / frontend line:

  • IONIC
  • React Native
16.04.2018 / 15:25