code: def app_state(self, app):
          
          if not self.available or not self.screen_on:
              return STATE_OFF
          if self.current_app["package"] == app:
              return STATE_ON
          return STATE_OFF
docs: Informs if application is running.