You created an app with a screen and a button,
tapping the button does some operation,
and it works.
Now you want to be able to do the following:
Run your app
Switch the focus to another app
Trigger the operation in your app
My question:What are my options for doing that?
For example,
Can I use the physical “Camera” button on my smartphone,
and make my app receive an event whenever my app is running and the camera button is pressed?
(even when my app is not the focussed one)
Or if not the camera button,
any other ideas that you have,
as long as they can trigger an operation in my app, when it’s running but not focussed this moment..
I ask you to close the topics you recently opened if you’ve found a solution
As for this problem, have you tried searching in the community?
Also, could you explain what you need to do outside the app?
You’ll surely need to use iToo,
Which is designed specifically to perform actions while the app is not in focus.
Some phones allow you to assign an app to a function button.
In this case, you could simply set up the procedure in the Screen.Initialize, and pressing the function button will open the app and also trigger the function.
Of course, this isn’t a “hidden” operation.
My app is a Clipboard connector, between my Smartphone and my PC.
So I have a button in my app, that copies the text from my PC’s Clipboard, to my Smartphone’s Clipboard.
Now imagine you’re in WhatsApp, and want to writte messages to a friend,
and every time you type something on the PC, you need to pass it to the Smartphone,
so currently I need to switch back and forth many times between my app, and WhatsApp,
just to tell me app to do the copying.. (via tapping the button on the screen).
I want to spare myself from that, via triggering my button in a different way.
So the app is open, but triggering an operation in it will be done without having to switch to it all the time.
Well, I think it can be solved.
You could use Firebase and take advantage of the .DataChanged function.
Basically, with iToo you create a process linked to Firebase.DataChanged, and from a PC you make a very simple program that sends messages to the database (you could also set an expiration to clean the bucket periodically).
Then, in Kodular, you create a procedure + iToo that reads the last received message and copies it to the clipboard.