Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Z1C and Tasker automation

OP wernyuen

24th August 2014, 09:01 AM   |  #1  
OP Member
Thanks Meter: 13
 
39 posts
Join Date:Joined: Jun 2007
More
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, 03:48 PM   |  #2  
Senior Member
Thanks Meter: 26
 
118 posts
Join Date:Joined: Mar 2009
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, 04:41 PM   |  #3  
OP Member
Thanks Meter: 13
 
39 posts
Join Date:Joined: Jun 2007
More
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, 05:47 PM   |  #4  
Senior Member
Thanks Meter: 26
 
118 posts
Join Date:Joined: Mar 2009
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 05:58 PM.
The Following User Says Thank You to Maetz3 For This Useful Post: [ View ]
24th August 2014, 06:43 PM   |  #5  
OP Member
Thanks Meter: 13
 
39 posts
Join Date:Joined: Jun 2007
More
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)
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