FORUMS

Analysis & Opinion

Z1C and Tasker automation

107 posts
Thanks Meter: 29
 
By wyt18, Senior Member on 24th August 2014, 08:01 AM
Post Reply Subscribe to Thread Email Thread
Thought I would create a thread to discuss Tasker automation on the Z1C (help requests, troubleshooting, automation ideas, etc.)

First a help request:

Has anyone been successful in getting AutoInput or Sendevent shell commands (double taps, swipes) to work on the Z1C?
I've used this script in the past to record events and replicate them to create macros using Tasker shell, but the Z1C input devices (touchscreen, buttons) don't seem to be allowing capture using getevent:
http://forum.xda-developers.com/show....php?t=2233865
 
 
24th August 2014, 02:48 PM |#2  
Senior Member
Thanks Meter: 32
 
More
Quote:
Originally Posted by wernyuen

Thought I would create a thread to discuss Tasker automation on the Z1C (help requests, troubleshooting, automation ideas, etc.)

First a help request:

Has anyone been successful in getting AutoInput or Sendevent shell commands (double taps, swipes) to work on the Z1C?
I've used this script in the past to record events and replicate them to create macros using Tasker shell, but the Z1C input devices (touchscreen, buttons) don't seem to be allowing capture using getevent:
http://forum.xda-developers.com/show....php?t=2233865

Edit: always execute as root!!!!

task Swipe:
Script
execute Shell
input swipe x1 y1 x2 y2 speed
like:
input swipe 310 870 310 320 200

keyevents:
http://developer.android.com/referen.../KeyEvent.html
like
power on/off
input keyevent 26 or
input keyevent KEYCODE_POWER

pause between actions:
sleep 1
sleep 2 etc.

tap:
input tap x y

start app:
am start -n app.name.name/ManifestActivity

close app:
am force-stop app.name.name

complete action screen on, unlock, start spotify, autoplay, screen off
am start -n com.spotify.music/.MainActivity;
sleep 2;
input keyevent 26;
sleep 1;
input swipe 310 870 310 320 200;
sleep 1;
input keyevent 126;
sleep 1;
input keyevent 26;

i hope it help
24th August 2014, 03:41 PM |#3  
Quote:
Originally Posted by Maetz3

Edit: always execute as root!!!!

task Swipe:
Script
execute Shell
input swipe x1 y1 x2 y2 speed
like:
input swipe 310 870 310 320 200

keyevents:
http://developer.android.com/referen.../KeyEvent.html
like
power on/off
input keyevent 26 or
input keyevent KEYCODE_POWER

pause between actions:
sleep 1
sleep 2 etc.

tap:
input tap x y

start app:
am start -n app.name.name/ManifestActivity

close app:
am force-stop app.name.name

complete action screen on, unlock, start spotify, autoplay, screen off
am start -n com.spotify.music/.MainActivity;
sleep 2;
input keyevent 26;
sleep 1;
input swipe 310 870 310 320 200;
sleep 1;
input keyevent 126;
sleep 1;
input keyevent 26;

i hope it help

thanks! very helpful.

what about multi-touch or pinch-to-zoom? have not been able to find solutions that have bridged that online

double tap also seems to be a challenge for the Z1C, somehow even without sleep in between two "input taps" it is still too slow to be recognized as a double tap
24th August 2014, 04:47 PM |#4  
Senior Member
Thanks Meter: 32
 
More
Quote:
Originally Posted by wernyuen

thanks! very helpful.

what about multi-touch or pinch-to-zoom? have not been able to find solutions that have bridged that online

double tap also seems to be a challenge for the Z1C, somehow even without sleep in between two "input taps" it is still too slow to be recognized as a double tap

i dont know but i think you need something like nova launcher

i think you can combine this controls in tasker

for zoom you can use:
KEYCODE_ZOOM_IN (input keyevent 168)
KEYCODE_ZOOM_OUT (input keyevent 169)
Last edited by Maetz3; 24th August 2014 at 04:58 PM.
The Following User Says Thank You to Maetz3 For This Useful Post: [ View ]
24th August 2014, 05:43 PM |#5  
Quote:
Originally Posted by Maetz3

i dont know but i think you need something like nova launcher

i think you can combine this controls in tasker

for zoom you can use:
KEYCODE_ZOOM_IN (input keyevent 168)
KEYCODE_ZOOM_OUT (input keyevent 169)

Thanks ... tried the ZOOM_IN/OUT keyevents, but I think that is for the camera, I'm trying to implement this on Google Maps and Maps Engine, since they removed the Zoom and Scaling buttons on the official Google apps it's been a pain (and driving hazard) to manually zoom in and out with touchscreen input. (trying to map the zoom actions to my media controls on the steering wheel)
5th January 2015, 01:38 PM |#6  
Junior Member
Thanks Meter: 0
 
More
Hi all,

Let me start with an apology as I am not sure that I am in the right thread here, however tasker automation does seem to have alot of threads - I am confident that someone who knows more than me might be able to answer my questions/problems.
I am currently trying to automate a search in youtube using autovoice and autoinput. Via voice command so far I can get autoinput to launch youtube, and click the search bar, however I cant get it to input any text into the search bar! - So I really need to know, how to get autoinput to input variable text and search for it within youtube, not even sure which function of autoinput it would be to be honest.
Still learning.

Any help you can give would be fantastic,
Cheers
Dan
6th January 2015, 05:45 PM |#7  
If what you want to achieve is to search YouTube, there are easier ways:
1. Simply ask Google Now to search or YouTube using the "watch" or "listen" command; or
2. Use an intent in Tasker to activate YouTube search with the search term %avcommnofilter (rather than try to use autoinput)

If you really must use autoinput, you can use the UI query action to find the right variable name for the search box, then use the 'autoinput action' action to paste your search term (%avcommnofilter) into the search box

Quote:
Originally Posted by dan34321

Hi all,

Let me start with an apology as I am not sure that I am in the right thread here, however tasker automation does seem to have alot of threads - I am confident that someone who knows more than me might be able to answer my questions/problems.
I am currently trying to automate a search in youtube using autovoice and autoinput. Via voice command so far I can get autoinput to launch youtube, and click the search bar, however I cant get it to input any text into the search bar! - So I really need to know, how to get autoinput to input variable text and search for it within youtube, not even sure which function of autoinput it would be to be honest.
Still learning.

Any help you can give would be fantastic,
Cheers
Dan

6th January 2015, 07:29 PM |#8  
Maciek602's Avatar
Senior Member
Thanks Meter: 153
 
Donate to Me
More
I have a slightly different question how to make a script turning stamina mode on and off? It would be usefull because stamina sometimes prevents alarm apps from ringing in time.
Post Reply Subscribe to Thread

Tags
autoapps, tasker, z1 compact
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes