victordiaz / PHONK

PHONK is a coding playground for new and old Android devices
https://phonk.app
GNU General Public License v3.0
461 stars 26 forks source link

PHONK for background automation #20

Open victordiaz opened 4 years ago

victordiaz commented 4 years ago

It was suggested if PHONK could automate things based on system events. I will play with the idea and open this issue to keep track of things

gtusr commented 2 years ago

Any progress yet on this front?

victordiaz commented 2 years ago

Hi @gtusr

Not really. I fixed some stuff to better run background scripts like a year ago but thats all. In theory lots of things could be done already. Is there something specific that you would like to do?

gtusr commented 2 years ago

I was just wondering if PHONK could someday become a replacement for Tasker since PHONK can already respond to various "profile triggers," as demonstrated on the project homepage.

I'm not familiar enough yet with the Android framework to estimate how much work would be required to re-create a "Tasker-like" engine that could manage several profiles simultaneously for the user in the background, but this is why I asked about whether or not developing a framework for managing background processes, that can balance issues like battery usage with responsiveness of the phone user interface during foreground activities, is on the future roadmap for PHONK.

victordiaz commented 2 years ago

I think lots of things can be done already.

For example mixing this 3 examples:

1) create a background running script with this https://github.com/victordiaz/PHONK/tree/develop/PHONK-examples/Advanced/Background%20App 2) Get the battery status with this https://github.com/victordiaz/PHONK/tree/develop/PHONK-examples/Device/Info 3) And depending on the battery status you could send a MQTT message to a broker https://github.com/victordiaz/PHONK/tree/develop/PHONK-examples/Network/MQTT or send a HTTP GET request https://github.com/victordiaz/PHONK/tree/develop/PHONK-examples/Network/HTTP%20GET

I will be happy to help if somebody has some needs that PHONK does not provide yet. We can try to figure out the best and easiest way to accomplish it :) So if you or anybody else have some need or suggestions that we could add to the baseline we already have I'm all ears :)

If you have any question feel free to ask. I know things are not very well documented, so the best way is running scripts and see how they work. I tried to keep all the examples small so they can be understood.