Hey, i have a question of background script

Hello
i wanted to ask that
is there any way through which we can run a script in background whether application is on or off

  • such script through which we can check validity or update some id pass of database or some other functions

The sole workaround would be actually to run the app and pass some command-line parameter. Then, depending on that, you can trigger actions. Check this: