Sort of. Your app can't be "opened" unless it is displaying one of the UI pages. These are generated from a call to a method corresponding to that page in your app code, and you can call whatever methods you want from there.
For example, if this is part if your app:
preferences {
page(name: "mainPage")
}
// ...
def mainPage() {
dynamicPage(name: "mainPage", title: "My Page") {
section {
paragraph "Stuff here..."
}
}
}
...you could put whatever you need to inside that mainPage()
method, e.g., a call to some other method in your app (or on a device, etc., though I really prefer to keep that kind of thing to a minimum on page loads). This will be called whenever that page is rendered, essentially whenever your app UI, or at least this page, is opened.
This might need to be a dynamicPage
instead of a plain page
to work (as above). With your kind of app, you might already be using these; if not, it's an easy change!