0

I want to use my Android phone (Samsung Galaxy A41) as a remote for opening garage door. For this to make any sense I need to be able to run some action without unlocking the phone, even without looking at it. I noticed that I can configure my phone to run any app after double pressing power button. If the app has UI it would show the unlocking screen, but seems it just runs the app prior to unlocking as when I set the app to be torchlight the light comes on and off whenever I double click power button, whether screen is locked or not.

So I can theoretically run any app. If I wrote an app that would eg. make a REST call then I would get the functionality I want. But can I do without writing my own trivial app? Writing own app is problematic from maintenance perspective.

I could imagine a super simple app that would just touch a file and an Automate flow running in the background would pick it up and make a HTTP call. So is there a no-UI Android application that would execute a script found in pre-defined place and exit? Note that Automate alone does not work as in the UI to pick application to run after double power button click I cannot select any shortcuts, just applications.

1
  • Did my answer help?
    – Destroy666
    Jan 10 at 12:15

1 Answer 1

0

Tasker is a much more powerful tool for Android automation than anything else. It can solve problems in many different ways, also with help of plugins.

Examples related to your problem:

  • Tasker by default can send HTTP requests based on many conditions, including button clicks, specific time, Bluetooth device/Wi-Fi network connection, etc. See e.g. this for a list of possible power button detections - some may not be available for non-rooted devices or some Android versions. I've personally been using logcat method on a rooted Android 10 phone.
  • plugin list coud have some helpful stuff, e.g. plugins related to button presses or smart home

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.