Desperately need help with this problem.

General discussions about Automagic and automation in general

Moderator: Martin

robchoc
Posts: 81
Joined: 20 Jun 2018 12:38

Desperately need help with this problem.

Post by robchoc » 21 Jun 2018 08:24

Unrooted devices only!

Is it possible to turn off or change to long press the phones capacitive buttons temporarily, until I press power or volume key?
If this is possible how would I go about doing this, please?
Or maybe there is another way?

The reason I need to do this is that some of my phones have very sensitive capacitive buttons on the front of the phone and keep being triggered due to Electromagnetic fields.
I don't think they have very good immunity as they are cheap phones and I have a lot of electromagnetic fields running in my phone farm.
This causes my phones to randomly press any of the 3 capacitive buttons and mess up my applications that are running preventing me from making money.

Another possibility could be that if a certain button is pressed maybe it could be undone or pressed again, not sure if that would undo the action on all buttons.
Maybe if an application is minimized it could be brought back to the front?

If none of this is possible maybe an email if one of the buttons have been pressed and I can then manually get the app back to the front again, this is a worst-case scenario.

Thanks for any help and tips.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Desperately need help with this problem.

Post by Desmanto » 21 Jun 2018 10:13

At first I was about to suggest to cover the whole capacitive buttons altogether with some kind of adhesive tap. Then I realized the cause was something intangible. Shielding it from the EMF, probably will cause other problem, weakening signal or additional unnecessary heat.

The best solution can only achieved by root, by disabling the hardware capacitive button and show only the soft navigation button, just adding one line in build.prop.

Code: Select all

qemu.hw.mainkeys=0
I know you can't do it, but just worth mention here, in case someone got into the similar trouble but have root.

The next solution only can be done via accessibility and feature introduced in Automagic 1.36.0 (currently still EAP). As you have thought, there is a new Hardware Key Event, which can be used to intercept the capacitive button, (menu, recent, home, back) and block it. But be careful when trying it, you should have another method to disable this flow, as you might blocked out yourself from using the capacitive key when the flow is enabled. You can use other method such as floating widget, floating navigation button or notification to disable the flow temporary when you need to use the capacitive button.

Other not so good solution that you've mentioned, but doesn't require you to install the EAP version (for now), is to use Trigger App Task Ended, choose the app you need. Add action Launch app and pick the app you need. Everytime the app get exit out by the mysterious EMF button-pressing, it will launch the app again, thus back to the original position. But same as above, you need to have other method to disable this flow. Since you can't go back to home screen anymore once you have activate the flow.

The alternative of this app task ended flow is a periodic timer. Periodically check every 5 seconds, if the app is not running, then launch the app. This probably will reduce the battery life significantly, so the app task ended is preferred (in case you can't use the other solutions). Bu you can increase the interval if it is not important down to seconds, example only every minute.


Creating Email notification is not a solution, that is not automation at all :D As it still need your manual interaction. So, shouldn't be considered at all :D
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

robchoc
Posts: 81
Joined: 20 Jun 2018 12:38

Re: Desperately need help with this problem.

Post by robchoc » 21 Jun 2018 13:16

Next question is where is the best place to learn how to use Automagic?

I have had experience a long time ago with programming in Visual Basic 5 and a bit of .Net
I have also done an Introduction to Java and Javascript and done a bit of C# and Pascal.
So I'm hoping that this will help me even if I'm very rusty with coding.

Once again thanks for all the help.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Desperately need help with this problem.

Post by Desmanto » 21 Jun 2018 16:49

The best way to learn it is to have strong need first and work your way out until you successfully created the flow. But it might be not suitable for some users.

For beginning, introduction tutorial, you can look at my index at my signature, the general section, there are several starting tutorial to help us. The complete documentation of each elements explanation also presented there. I spent 4 days just to read the documentation when the first time I started to use Automagic. Learning other language also helps a lot, especially javascript (or java if you dare). I am still learning python (because need to use it in eventghost), and it helps also for the Automagic logic. But automagic is not about the scripting alone (although we are going to use it a lot). There are a lot of other elements too we can use, those integrate to our daily activities. You got to have some purposes to achieve first and find the way to do it in Automagic.

I just realized I have used Automagic for 1 year. And looking back, my automation skill has improved so much compared to last year when I still stucked at tasker. Automagic scripting language is my main programming language now. I can code much faster and effective than using other programming language, even faster than python. I can see that I only improved everytime I try to solve new problem. I almost know nothing about regex last year, but now regex is one of my daily meal. I rarely use scene in tasker, but I have 2 dozens of widget now in Automagic. I never use map/list type variable, but today I am heavily relied upon them. Parsing data from text, csv, json, xml, html have never been so much fun like now.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

robchoc
Posts: 81
Joined: 20 Jun 2018 12:38

Re: Desperately need help with this problem.

Post by robchoc » 04 Oct 2018 11:50

Still waiting for version 1.36 so that I can block hardware keys.

I have successfully managed to do this in Tasker and it works really well. As soon as 1.36 is out I will try to do the same with Automagic (with a bit of help :) ) as I want to move over to using Automagic but still, some things can't be done in Automagic that I need to be able to do before I leave Tasker.

An example was that I created a scene to cover the screen in black with a very slight transparency that would come on at night so that I could leave my device on and not have to cover with a cloth.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Desperately need help with this problem.

Post by Desmanto » 04 Oct 2018 16:38

How do you block it in tasker? AFAIK, you still need to use autoinput. If that so, then you can use Automagic and use the same autoinput plugin to block it too. As soon as 1.36 is released to playstore, then autoinput would become completely redundant. As automagic already can do what autoinput can.

I am curious if there are still somethings tasker can do but automagic can't. Can you give me some more examples?

To create scene, use widget. You can create a widget as big as your screen resolution, set it to black with little transparency as you do in tasker. Then use action Show widget to cover the whole screen. Be careful though when playing with full screen widget. It is possible to lock yourself out, that you need to force restart the phone to make the widget go away. Similar concept to use the full screen widget as screen saver here : viewtopic.php?f=3&t=6963

I use the similar concept too to block my screen during certain condition. So I won't mistap anything inside the app.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

robchoc
Posts: 81
Joined: 20 Jun 2018 12:38

Re: Desperately need help with this problem.

Post by robchoc » 04 Oct 2018 18:31

Yes, I rely on Autoinput heavily for most of my automation.

I'm trying to think what my scripts can do, that I don't think Automagic can do.
I think I have some to start with.

1. The ability to create a large countdown clock on my screen, I use scene for that one.
2. Remap my volume control to trigger a task for up and another task for down. Autoinput is used for that.
3. Customised shortcut icons or a large variety.

I also have a question for you.
Can you call a notification function from within a script?

For example something like:

Notification{variable}

Thanks for your replies.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Desperately need help with this problem.

Post by Desmanto » 05 Oct 2018 05:35

If you relied upon autoinput so much, Control UI will be very useful. It is my top 5 actions used, with 80 usages currently.

1. Tasker scene is much more powerful than automagic widget. In fact too powerful, that I rarely use it. Automagic input dialog is much more useful in most of my usages. Takes too long to design a working interface, while I can just slap the list of choices into automagic input dialog. Depends on how you design the clock, we can create the similar too using widget : viewtopic.php?f=5&t=7276&p=20656&hilit=timer#p20620
But it is not recommended to use animation with widget, as it is quite slow (max 2 fps)

2. You can't do this using tasker alone. Using Autoinput, automagic can also do it.

3. Do you mean the shortcut icon when creating shortcut? In this part, tasker win in term of built-in icon. But both still can use custom app icon. And you can also extract out tasker's icons to use in Automagic.

4. Do you mean pull down the notification? You can use Control UI - notifications(). (no parameter) If you mean to act on the notification or to process it, use action/trigger, search for "notification"
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

robchoc
Posts: 81
Joined: 20 Jun 2018 12:38

Re: Desperately need help with this problem.

Post by robchoc » 05 Oct 2018 13:05

Thanks for that, did not know you could make the widget go full screen.

What I was trying to say with the last part was, is it possible to just use a notification within a script, like the alert action but without having to add another action box in your flow.

Example:

a = 10
b = 20
Answer = a + b
Notification {Answer} (Would pop up 30 on the screen when you execute this script)
sleep (5000)
....
....

Or would you have to break up the script and drag in the action for notification and then continue the script with another script box after the notification action?

Hope that's clear

Thanks.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Desperately need help with this problem.

Post by Desmanto » 05 Oct 2018 16:59

Ok, as ex-tasker I understand your need. You want to show the variable value in toast message. In tasker, it is Alert > Flash. While in Automagic, it is Action > Notification on Screen. Both require you to put the variable you want to show in the field.

There is no function to pop up the toast message directly from the script. You have to add the notification on screen after the script and put the variable you want there using braces, {Answer} And if you want to continue to modify the value, yes, you have to add another script element to modify it. AFAIK, tasker has to do the same, right? But in automagic, you can put them in parallel. So the next script and notification on screen can be added from the previous script. They will be executed at the same time, on same execution step. No need to break the current flow logic, you can simply attach to the script you want to check.

But forget about it, all you want is to trace your variable during execution. Simply use Condition - Debug Dialog. Put this after your script. There is no configuration required, no need to add each variable you want to show. It will directly show you every single variable available after the execution to that point, including the global variable. You can add, delete, change the variable on the fly, before proceeding to the next element execution. Detail instruction on how to use Debug dialog is presented here : viewtopic.php?f=5&t=7262
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply