Atrix 4g Screen Shot With Adjustable Self-Timer! [11 May 2013] - Atrix 4G Android Development

JB/ICS ROMs allow you to take a screenshot by long-pressing the Power and Volume Down simultaneously. But you may get unwanted screen artifacts or other strange behavior if you don’t press them exactly at the same time.
But my new Atrix4g Screen Shot (A4G SS) tool overcomes by invoking virtual key presses for Power and Volume Down using the “sendevent” command. Basically it’s remote control.
And it has a self-timer with adjustable delay. So among other things, you can run it with your built-in camera to take family/group portraits --- though the camera buttons will show .
Flashable zip (0.2 MB): http://www.mediafire.com/?18h1bzqcca3g15u
A4GG SS is tested working on CM10 SuperLite. I was going to try it on other JB/ICS ROMs but I ran out of time.
There are many ways to launch A4G SS. Examples:
Root Explorer (very simple once you set home directory to /system/bin)
Script Manager (not as simple at first, but easily configurable and settings are retained)
Terminal Emulator (not as simple but geeky)
ADB (remote operation)
Instructions on how to configure A4GG with Script Manager are given further below.
Key legends reside in the /system/usr/keylayout directory. Those of interest here are documented in my A4GG SS launch code:
Code:
#!/system/bin/sh
echo
echo "Atrix4g Screen Shot With Self-Timer!"
echo "Usage: sh a4g-screencap.sh [timer delay (sec)]"
echo "Default delay: 10 sec"
echo
echo "Initial Release: 11 May 2013"
echo "sendust7 @ xda developers"
#Atrix4g key map legends (decimal):
#/dev/input/event0
#key 107 POWER WAKE
#key 26 POWER WAKE
#key 226 HEADSETHOOK WAKE
#/dev/input/event1
#key 102 HOME WAKE
#key 139 MENU WAKE_DROPPED
#key 158 BACK WAKE_DROPPED
#key 211 FOCUS
#key 212 CAMERA
#key 115 VOLUME_UP WAKE
#key 114 VOLUME_DOWN WAKE
#key 217 SEARCH WAKE_DROPPED
echo
if grep -qs $EXTERNAL_STORAGE /proc/mounts; then
echo "$EXTERNAL_STORAGE mounted"
elif grep -qs $SECONDARY_STORAGE /proc/mounts; then
echo "$SECONDARY_STORAGE mounted"
else
echo "Phone storage not mounted. Exiting..."
exit 1
fi
echo
if [ $# -eq 0 ]; then
echo "Taking screen shot in 10 seconds..."
sleep 10
else
echo "Taking screen shot in $1 seconds..."
sleep $1
fi
#Long press POWER and VOL Down simultaneously
/system/bin/sendevent /dev/input/event0 1 107 1
/system/bin/sendevent /dev/input/event1 1 114 1
sleep 2
#Release POWER and VOL Down simultaneously
/system/bin/sendevent /dev/input/event0 1 107 0
/system/bin/sendevent /dev/input/event1 1 114 0
echo
echo "Done! Can exit now..."
exit 0
Instructions
Simply flash zip, reboot and optionally install/configure Script Manager (SManager): Go to Settings > Advanced > Configuration > Home directory. Navigate to /system/bin and “Select this directory” at bottom.
SManager: https://play.google.com/store/apps/details?id=os.tools.scriptmanager&hl=en
Make sure USB storage is turned off to save your screenshot. A4G SS includes logic to exit unless internal storage, external storage or both are mounted.
Then re-launch SManager, navigate to “/system/bin/atrix4g-ss-v1.0.sh” and tap:
Code:
“Su” (run as root --- setting is retained for later)
“Run”
“Home” (navigate to screen of interest)
Wait for the timeout. A message: “Saving screenshot” will appear at top. To view your screenshot, simply drag the pull down menu, tap the “Screenshot captured” bar and complete the action.
After screenshot, A4G SS exits gracefully. To re-launch from SManager, tap HOME > “Run Again”. To exit, tap the Back button on your Atrix.
If you want to change the default 10-second timeout, simply enter a different (positive) number in SManager’s argument box and re-launch. This setting is also retained.
Things go pretty fast after initial setup.
I understand many screenshot apps are available, and Screenshot UX is my favorite. But the trial version expires after 14 rounds  --- not because I don’t like to pay for a good app. I just don’t like Google having my credit card number.
My A4G SS tool is free, and the maximum allowable number of screenshots is limited only by available storage
You can also run A4G SS from ADB-enabled remote device:
adb shell /system/bin/atrix4g-ss-v1.0.sh [N]
where N = delay time (sec).
This is how I took demo shots of A4G SS in action I just set N=0 for an instant shot.
And you can spin your Atrix beauty into an efficient "still-moving" security cam using a delayed while loop and camera ON/shoot/OFF commands at fixed intervals. Something like this…
Code:
#Wait two hours
sleep 7200
#Start monitoring
while :
do
/system/bin/sendevent /dev/input/event1 1 212 1
sleep 2
#Long press POWER and VOL Down simultaneously
/system/bin/sendevent /dev/input/event0 1 107 1
/system/bin/sendevent /dev/input/event1 1 114 1
sleep 2
#Release POWER and VOL Down simultaneously
/system/bin/sendevent /dev/input/event0 1 107 0
/system/bin/sendevent /dev/input/event1 1 114 0
sleep 2
/system/bin/sendevent /dev/input/event1 1 158 0
#Wait 5 minutes until next picture
sleep 300
done
The companion “getevent” command is also very useful. For example it helps you learn the various key legends or to capture a time stamped history of sendevent commands.
Code:
Usage: getevent [-t] [-n] [-s switchmask] [-S] [-v [mask]] [-d] [-p] [-i] [-l] [-q] [-c count] [-r] [device]
-t: show time stamps
-n: don't print newlines
-s: print switch states for given bits
-S: print all switch states
-v: verbosity mask (errs=1, dev=2, name=4, info=8, vers=16, pos. events=32, props=64)
-d: show HID descriptor, if available
-p: show possible events (errs, dev, name, pos. events)
-i: show all device info and possible events
-l: label event types and names in plain text
-q: quiet (clear verbosity mask)
-c: print given number of events then exit
-r: print rate events are received
1|[email protected]:/ #
Screenshots
Blessings... Enjoy!
Disclaimer: Standard disclaimers apply.
References:
http://android.stackexchange.com/questions/26261/documentation-for-adb-shell-getevent-sendevent
http://source.android.com/tech/input/getevent.html
http://fangmobile.com/2012/11/06/an...lick-on-screen-for-ics-and-may-be-jelly-bean/
https://groups.google.com/forum/?fromgroups=#!topic/android-beginners/il2PqSKRFNI

1st
Thanks for this useful app
I will try it soon

Related

Help with smartskey and the Cingular 8125

I just "installed" smartskey onto my Cingular 8125 and I get the soft keys to work (holding the left softkey activates the start menu) but I can't get any other functions to work, mainly the volume/jog and the dpad launcher.
Can someone tell me what's missing? Thanks!
This is my config (pretty much the default):
; INI FILE MUST BE SAVED IN UNICODE, PLEASE USE NOTEPAD TO EDIT IT
[MAIN]
; set LSKEY to 1 if you want to override Left Soft Key (DEFAULT 1)
LSKEY=1
; set RSKEY to 1 if you want to override Right Soft Key (DEFAULT 1)
RSKEY=1
; set VOLKEY to 1 if you want to override Volume Key (DEFAULT 1)
VOLKEY=1
; set DPAD to 1 if you want to use dpad to launch call log, contacts in phone app (DEFAULT 1)
DPAD=1
; set CLOSEAPP to 1 if you want to close app instead of hide (DEFAULT 0)
CLOSEAPP=1
; set STARTONREBOOT=1 to 1 if you the program to be start automatically during
; reboot, use with RSKEY (DEFAULT 0)
STARTONREBOOT=1
; set VOLUMEONPHONE=1 if you want to set volume using volume key in phone app
; use with VOLKEY (DEFAULT 1)
VOLUMEONPHONE=1
; set VOLUMEONTODAY=1 if you want to set volume using volume key in today
; use with VOLKEY (DEFAULT 1)
VOLUMEONTODAY=1
; use with lskey, rskey (DEFAULT 1)
PAGEONEXPLORE=0
; set OMAPCLOCK to the clock if you want to use omapclock and automatically
; set the clock speed after wakeup, you should put OmapClock.exe in the same
; directory of smartskey.exe
; REMEMBER TO REMOVE ';' BEFORE THE LINE TO ENABLE IT
;OMAPCLOCK=264
;REMOVEDUPSDDAEMON=0
;STARTMENUMETHOD=0
DUP=2
DDOWN=3
DRIGHT=1
DLEFT=4
; if you set CLOSEAPP to 1, the program will hide the following
; apps (by title) instead of closing. Other apps will be closed.
; maximum can set 16 apps
[EXCEPTIONLIST]
APP00=Text Messages
APP01=Outlook E-mail
APP02=Hotmail
APP04=MMS
APP05=Contacts
APP06=Calendar
APP07=Camera
Jason_Wilkerson said:
I just "installed" smartskey onto my Cingular 8125 and I get the soft keys to work (holding the left softkey activates the start menu) but I can't get any other functions to work, mainly the volume/jog and the dpad launcher.
Can someone tell me what's missing? Thanks!
This is my config (pretty much the default):
; INI FILE MUST BE SAVED IN UNICODE, PLEASE USE NOTEPAD TO EDIT IT
[MAIN]
; set LSKEY to 1 if you want to override Left Soft Key (DEFAULT 1)
LSKEY=1
; set RSKEY to 1 if you want to override Right Soft Key (DEFAULT 1)
RSKEY=1
; set VOLKEY to 1 if you want to override Volume Key (DEFAULT 1)
VOLKEY=1
; set DPAD to 1 if you want to use dpad to launch call log, contacts in phone app (DEFAULT 1)
DPAD=1
; set CLOSEAPP to 1 if you want to close app instead of hide (DEFAULT 0)
CLOSEAPP=1
; set STARTONREBOOT=1 to 1 if you the program to be start automatically during
; reboot, use with RSKEY (DEFAULT 0)
STARTONREBOOT=1
; set VOLUMEONPHONE=1 if you want to set volume using volume key in phone app
; use with VOLKEY (DEFAULT 1)
VOLUMEONPHONE=1
; set VOLUMEONTODAY=1 if you want to set volume using volume key in today
; use with VOLKEY (DEFAULT 1)
VOLUMEONTODAY=1
; use with lskey, rskey (DEFAULT 1)
PAGEONEXPLORE=0
; set OMAPCLOCK to the clock if you want to use omapclock and automatically
; set the clock speed after wakeup, you should put OmapClock.exe in the same
; directory of smartskey.exe
; REMEMBER TO REMOVE ';' BEFORE THE LINE TO ENABLE IT
;OMAPCLOCK=264
;REMOVEDUPSDDAEMON=0
;STARTMENUMETHOD=0
DUP=2
DDOWN=3
DRIGHT=1
DLEFT=4
; if you set CLOSEAPP to 1, the program will hide the following
; apps (by title) instead of closing. Other apps will be closed.
; maximum can set 16 apps
[EXCEPTIONLIST]
APP00=Text Messages
APP01=Outlook E-mail
APP02=Hotmail
APP04=MMS
APP05=Contacts
APP06=Calendar
APP07=Camera
Click to expand...
Click to collapse
To use the Volume slider as a "Jog Wheel" yo need "PAGEONEXPLORE=1" not "PAGEONEXPLORE=0" as you currently have set. Make this change and soft reset, or tap the shortcut to "Launch" smartskeys. this will present a dialog window to close it, do so, then relaunch using the shortcut.
Thanks! That corrected the "jog wheel" but any suggestions on the DPad problem?
Jason
I'm not sure I understand the question. What are you trying to do with the DPad?
The documentation says that you can use the dpad to launch 4 different applications, depending on the direction:
DUP=x
DDOWN=x
DLEFT=x
DRIGHT=x
x =
0: Do nothing
1: Call Log
2: Quick Dial
3: Contacts
4: Messaging
Nevermind - I just figured it out... I thought this would work from the Today screen, but you have to be in the Phone Application.
Thanks for the help though!
Jason
Dpad problem
Jason_Wilkerson said:
Nevermind - I just figured it out... I thought this would work from the Today screen, but you have to be in the Phone Application.
Click to expand...
Click to collapse
Well, but dpad is not working for me (details)
Nobody has an idea?

HOWTO: Make Vol- act as a menu button

Connect nootered nook (note, that's post-nootering; you're not connecting with the nooter card -in- the nook) via usb.
- # adb pull /system/usr/keylayout
-- edit 'TWL4030_Keypad.kl' and 'omap_twl4030keypad.kl' with your text editor of choice; I used vi, always a safe choice.
-- replace 'VOLUME_DOWN' with 'MENU' in each
- # adb shell
- # mount -o rw,remount -t ext2 /dev/block/mmcblk0p5 /system
- # exit
- # adb push TWL4030_Keypad.kl /system/usr/keylayout/TWL4030_Keypad.kl
- # adb push omap_twl4030keypad.kl /system/usr/keylayout/omap_twl4030keypad.kl
- # adb shell
- # cd /system/usr/keylayout
- # chmod 644 omap_twl4030keypad.kl
- # chmod 644 TWL4030_Keypad.kl
- # cd /
- # mount -o ro,remount -t ext2 /dev/block/mmcblk0p5 /system
- # exit
- # adb reboot
After this, vol down hardbutton is vol down no more, it's a menu button. Enjoy. Thanks to staulkor and the person who posted that button remapping thread.
EDIT: Thanks jasoraso, for catching a typo.
Great... Thank you very much. Additionally I will also map volume + to BACK once I got my NC.
I also don't really need the volume control... and I bet you can always use a sound manager app.
how would you undo this?
cabbieBot said:
how would you undo this?
Click to expand...
Click to collapse
Same as doing it in the first place, but replacing
-- replace 'VOLUME_DOWN' with 'MENU' in each
with
-- replace 'MENU' with 'VOLUME_DOWN' in each
Works perfect, I now have Vol Up as BACK and Vol Down as MENU
Totally awesome!!! FBreader (my favorite way to read ebooks) works fabulously now - I hate being constrained to black and white to read.
I got an NC because I really needed an ebook reader...both my Visor and my Ipaq died and I'd been reading using FBreader on my netbook, but this is sooo perfect
Yeah, that works quite amazingly! Thanks for posting!
Thanks for this tip! I have re-mapped my volume up to MENU and the Volume Down to BACK. Aldiko works great now!!!
Work great. Thanks so much.
So once you do this, how do you change your volume?
buffnutz1 said:
So once you do this, how do you change your volume?
Click to expand...
Click to collapse
Nook settings.
Would someone please pastebin these two files?
/system/usr/keylayout/TWL4030_Keypad.kl
/system/usr/keylayout/omap_twl4030keypad.kl
I messed up, and I'd like a known-good state to start from again.
So due to SoftKeys this isn't really necessary anymore... but I forget which lines I changed to menu and back...
What I have:
key 158 BACK WAKE_DROPPED
key 14 BACK WAKE_DROPPED
key 229 MENU WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 59 MENU WAKE_DROPPED
Since there isn't a back or menu button, I'm guessing just changing all BACKs to VOLUME_UP and all MENUs to VOLUME_DOWN would be sufficient, but I'm not sure... any ideas?
i remapped both buttons, works great, thanks!
now I noticed that the default NC Screen Capture function doesn't work ( hold down "n" + "vol down" buttons at the same time )
has anyone figured out a way to re-mapp this functionality?
i don't use it often, so is it just a trade off I'll have to live with?
Possible using Root Explorer?
Would this be possible to do without ADB? Instead using root explorer?
Simply replace the text files:
key 115 VOLUME_UP to key 115 MENU
and
key 114 VOLUME_DOWN to key 114 BACK
Or do the ADB commands actually replace more in the file than that?
Thanks
I am sure I've seen an app on the market which lets you remap buttons to other functions, but I sure can't find it now.
It'd be really nice to have Back/Menu AND Vol +/- available via long presses.
Awesome! Thanks. I also replaced the VOLUME_UP with BACK.
Would be great to have a widget to toggle back and forth between volume control and back/menu control with the hard keys! Anybody?
It is much easier and faster to just use root explorer to modify the lines in
system/usr/keylayout/TWL4030_Keypad.kl
change 114 to MENU
change 115 to BACK
Reboot.
Done.
To revert back just rename 115 to VOLUME_UP and 114 to VOLUME_DOWN
buffnutz1 said:
So once you do this, how do you change your volume?
Click to expand...
Click to collapse
I just use volumer++ from the market.
this is actually part of [SCRIPT - 1/9/11] NookColor Auto Config (Windows) 1.0.0 & 1.0.1
in the Dev section. http://forum.xda-developers.com/showthread.php?t=877745
methfan said:
i remapped both buttons, works great, thanks!
now I noticed that the default NC Screen Capture function doesn't work ( hold down "n" + "vol down" buttons at the same time )
has anyone figured out a way to re-mapp this functionality?
i don't use it often, so is it just a trade off I'll have to live with?
Click to expand...
Click to collapse
I believe this happened to me, too. My screen capture function no longer works after remapping my volume buttons. I'll post here if I find a solution.

[tasker] clear recent apps command

Hi all,
I would like to add a button on my home screen in order to clear all recent apps without having to long press on the home button and so on.
Is there any command or variable on tasker to make this possible?
Thx for helping
Envoyé avec ma brique Galaxy Note.
Advanced Task Killer (in playstore).
And then place the widget on home screen.
One-click-kill.
I just want to clear recent apps not kill all tasks! I already have greenify.
Envoyé avec ma brique Galaxy Note.
bump. i need that too...
A little help from someone?
Envoyé avec ma brique Galaxy Note.
pakman023 said:
I would like to add a button on my home screen in order to clear all recent apps without having to long press on the home button and so on.
Is there any command or variable on tasker to make this possible?
Click to expand...
Click to collapse
I would like to have something like that as well to call it from Llama, so it should be either a simple application that clears all recent apps on start without asking or an intent that can be called by LLama.
Thx!
Envoyé avec ma brique Galaxy Note.
newest lbe ha a toggle for that, 360 launcher as well. when using both ram is quickly cleared.
Given androids ram optimalization its also quickly filled again lol.
Sent from my GT-N7000 using Tapatalk 2
Looking for a similar solution I ended up just using sendevent commands to simulate long pressing the home button & input tap
sendevent /dev/input/event16 1 172 1
sendevent /dev/input/event16 0 0 0
sleep 1
sendevent /dev/input/event16 1 172 0
sendevent /dev/input/event16 0 0 0
input tap 900 1850
Works great on my S4 but you may need to enable pointer in developer options & modify the tap x y. Similarly I also wanted to clear my ram & app cache & ended up putting it all together in 2 tasks that perform either with shake events(etcha sketch?)
okninja said:
(etcha sketch?)
Click to expand...
Click to collapse
oooh yeah!!!! nice touch
Install xposed framework and then Gravity Box will give you the option on a nexus 5. Couldn't find the option on Tasker either.
Is this configured under "Shell Script"?
okninja said:
Looking for a similar solution I ended up just using sendevent commands to simulate long pressing the home button & input tap
sendevent /dev/input/event16 1 172 1
sendevent /dev/input/event16 0 0 0
sleep 1
sendevent /dev/input/event16 1 172 0
sendevent /dev/input/event16 0 0 0
input tap 900 1850
Works great on my S4 but you may need to enable pointer in developer options & modify the tap x y. Similarly I also wanted to clear my ram & app cache & ended up putting it all together in 2 tasks that perform either with shake events(etcha sketch?)
Click to expand...
Click to collapse
okninja said:
Looking for a similar solution I ended up just using sendevent commands to simulate long pressing the home button & input tap
sendevent /dev/input/event16 1 172 1
sendevent /dev/input/event16 0 0 0
sleep 1
sendevent /dev/input/event16 1 172 0
sendevent /dev/input/event16 0 0 0
input tap 900 1850
Works great on my S4 but you may need to enable pointer in developer options & modify the tap x y. Similarly I also wanted to clear my ram & app cache & ended up putting it all together in 2 tasks that perform either with shake events(etcha sketch?)
Click to expand...
Click to collapse
Could you explain how you did this?
I've spent the last hour trying to get it done on my AT&T Galaxy S4 running GPE 4.4 ROM and can't get it to work.
Thanks!
Extra help
Hi, I'm new to forums and Tasker. Could you please explain step-by-step how you created this please? Your method seems to be the only one on the internet.... and its beyond my knowledge of Tasker.
Thanks
okninja said:
Looking for a similar solution I ended up just using sendevent commands to simulate long pressing the home button & input tap
sendevent /dev/input/event16 1 172 1
sendevent /dev/input/event16 0 0 0
sleep 1
sendevent /dev/input/event16 1 172 0
sendevent /dev/input/event16 0 0 0
input tap 900 1850
Works great on my S4 but you may need to enable pointer in developer options & modify the tap x y. Similarly I also wanted to clear my ram & app cache & ended up putting it all together in 2 tasks that perform either with shake events(etcha sketch?)
Click to expand...
Click to collapse
Storm85 said:
Hi, I'm new to forums and Tasker. Could you please explain step-by-step how you created this please? Your method seems to be the only one on the internet.... and its beyond my knowledge of Tasker.
Thanks
Click to expand...
Click to collapse
Hi guys landed here because I searched for this problem ....
I came up with a solution myself since the method described here is different for every device I think this should work for most
Open tasker -->new task--> script ---> run shell --> and paste this in the command line :
input keyevent APP_SWITCH
input tap 2150 1540
these numbers "2150 1540 " are for my note 10.1 2014 edition ... these are coordinates which set the location for the simulated touch tap ...
you can get your x y coordinates by enabling show cursor position in develepor options
this command does open the recent apps menu
and presses the close all all apps button
greetings
Medy89
Medy89 said:
Hi guys landed here because I searched for this problem ....
I came up with a solution myself since the method described here is different for every device I think this should work for most
Open tasker -->new task--> script ---> run shell --> and paste this in the command line :
input keyevent APP_SWITCH
input tap 2150 1540
these numbers "2150 1540 " are for my note 10.1 2014 edition ... these are coordinates which set the location for the simulated touch tap ...
you can get your x y coordinates by enabling show cursor position in develepor options
this command does open the recent apps menu
and presses the close all all apps button
greetings
Medy89
Click to expand...
Click to collapse
Thanks for this. However it isn’t working. I have a Galaxy Note 3 and assuming it’s the Xv: and Yv co ordinates I have 0.073 and 0.263.
But when I enter
input keyevent APP_SWITCH
input tap 0.073 0.263
It doesn’t work and the task seems to take a while to stop running.
What am I doing wrong?
If I do
new task--> script ---> run shell --> input keyevent APP_SWITCH
and click run should it open up the recent apps list? Because it doesn’t.
Thanks,
Storm85 said:
Thanks for this. However it isn’t working. I have a Galaxy Note 3 and assuming it’s the Xv: and Yv co ordinates I have 0.073 and 0.263.
But when I enter
input keyevent APP_SWITCH
input tap 0.073 0.263
It doesn’t work and the task seems to take a while to stop running.
What am I doing wrong?
If I do
new task--> script ---> run shell --> input keyevent APP_SWITCH
and click run should it open up the recent apps list? Because it doesn’t.
Thanks,
Click to expand...
Click to collapse
From what I understand, note 10.1 2014 still running on Android 4.3 but Note 3 already in 4.4.2, I guess Kitkat might have change this.
Storm85 said:
Thanks for this. However it isn’t working. I have a Galaxy Note 3 and assuming it’s the Xv: and Yv co ordinates I have 0.073 and 0.263.
But when I enter
input keyevent APP_SWITCH
input tap 0.073 0.263
It doesn’t work and the task seems to take a while to stop running.
What am I doing wrong?
If I do
new task--> script ---> run shell --> input keyevent APP_SWITCH
and click run should it open up the recent apps list? Because it doesn’t.
Thanks,
Click to expand...
Click to collapse
just take the X and Y not Xv Yv
there schouldnt be points and commas
ill check if input keyevent APP_SWITCH works on kitkat
meanwhile try
input keyevent KEYCODE_APP_SWITCH
look again
btw im doing a tasker series on youtube ill probably do a vid about this some time
check out my channel^^
First vid :
https://www.youtube.com/watch?v=KYADIOL_LPE&feature=youtu.be
Medy89 said:
just take the X and Y not Xv Yv
there schouldnt be points and commas
ill check if input keyevent APP_SWITCH works on kitkat
meanwhile try
input keyevent KEYCODE_APP_SWITCH
look again
btw im doing a tasker series on youtube ill probably do a vid about this some time
check out my channel^^
First vid :
https://www.youtube.com/watch?v=KYADIOL_LPE&feature=youtu.be
Click to expand...
Click to collapse
i have android kitkat..
i couldnt call input keyevent KEYCODE_APP_SWITCH
nothing happen..somebody help
bdkbaik said:
i have android kitkat..
i couldnt call input keyevent KEYCODE_APP_SWITCH
nothing happen..somebody help
Click to expand...
Click to collapse
it works on kitkat ... just tried it ... u need ROOT

Slipsystems Automate My Life

AUTOMATE MY LIFE
A LIST OF AUTOMATION SCRIPTS AND PROGRAMS THAT WILL AUTOMATE YOUR EVERYDAY LIFE.
MOST BUT NOT ALL OF THESE TUTORIALS REQUIRE TASKER AND A PLUGIN OF SOME SORT.
WINDOWS TUTORIALS CAN BE FOUND IN THE FIRST POST.
LINUX TUTORIALS CAN BE FOUND IN THE SECOND POST.
GENERAL TUTORIALS CAN BE FOUND IN BOTH POSTS.
THERE WILL BE SOME TASKS THAT ARE ONLY LISTED ON WINDOWS AND SOME TASKS THAT ARE ONLY ONLY LISTED ON LINUX, THIS DOES NOT MEAN IT IS NOT POSSIBLE TO PERFORM THEM ON OTHER PLATFORMS IT JUST MEANS I AM UNSURE OF HOW TO GET THEM TO WORK.
WINDOWS
Automatically Turn On Your Computer on a Schedule
Over View
This task is reasonable easy to set up, It will allow you to turn on your home or work pc on a schedule. In this case we are turning on our computer as soon as we unplug our device from the charger.
Requirements
Tasker
Wol Wake on Lan Wan
Setup
Before we get into creating our task we first need to set up the Wol Wake on Lan Wan application
Enable Wake on Lan
On the computer go to Control Panel>Network and Internet>Network and Sharing Center
Click on Change Adapter settings
Right Click on Ethernet and go to properties
Click Configure and then click the Advanced tab
Find Wake on Magic Packet and Change the Value to Enabled
Find Your Mac Address
Open Command Prompt
type "ipconfig /all"
under Ethernet adapter find physical address(00-11-22-33-44-55)
Remember It or write it down
Setup Wol Wake on Lan Wan
Open Wol Wake on Lan Wan
Press Add New
Under Name Call It Anything
Under Mac Enter your mac address as in ipconfig
Under SecureOn Leave As Is
Under IP or Domain Enter your Default Gateway also found in ipconfig
Under Port Leave as is
Check Send as Broadcast
The Rest is fine as default
Press Save
Create The Task
Open Tasker
Press the TASKS Tab
Press The +
Give The Task A Name Like Switch on Home PC
Press The +
Press Plugin
Press WoL Wake On Lan
Press the configuration pencil
Select the name you chose when setting up Wol Wake on Lan
Press the back button twice to save changes to configuration and task
Create The Profile
Press the profiles tab
Press the + Button to add a new profile
Select State
Select Power
Select Power
Select Source Any
press back to save
select the task we created
long press on the task and press move to exit
LINUX
Notify Me When Detecting Movement In My House
Overview
We will use simplecv as a security camera to detect motion in our house. it will then send a notification to our phone alerting us that someone is inside.
Requirements
SimpleCV
WebCam or IP Camera
Tasker
Autoremote
Setup
Install SimpleCV
Thanks To Tinkernut for this tutorial
Open Terminal and Type
Code:
sudo apt-get update
sudo apt-get install ipython python-opencv python-scipy python-numpy python-setuptools
sudo pip install https://github.com/sightmachine/SimpleCV/zipball/master
sudo pip install pyparsing svgwrite
simplecv
Setting Up The Script
Make a new python file called camera.py
Code:
sudo nano camera.py
and paste this code
Code:
'''THIS IS A MOTION DETECTING PROGRAM FOR THE RASPBERRY PI
It is part of a tutorial series that you can find here:
https://www.youtube.com/playlist?list=PLlg8lN4r9qWiDzF13lJY-lGtiTFHHGcpx
Running this program requires installing SimpleCV as well as
a few other prerequisits on your pi. You can find detailed
instructions for how to do that here:
http://tinkernut.com/YtQH9
The script was slightly modified by slipsystem to send a autoremote command
'''
#!/usr/bin/python
#import the SimpleCV, shutil and urllib libraries
from SimpleCV import *
import shutil
import urllib
#set autoremote variables
#key taken from http://goo.gl/xxxxx
autoremotekey = ""
#message to send autoremote
autoremotemessage = "Motion Detected"
#initialize the camera
cam = Camera()
#set the max display size
display = Display((800,600))
#create a threshold variable to change motion sensitivity
threshold = 0.5
#get the date for saving images
datestr = time.strftime("%Y%m%d")
#set a streaming variable to stream webcam online
streaming = JpegStreamer("0.0.0.0:1212")
#create destination directorie for the pictures
dst = "pic/%s" % (datestr) #destination directory for images
#if the picture directories don't exist, create them
if not os.path.exists(dst):
os.makedirs(dst)
#create a loop that constantly grabs new images from the webcam
while True:
#set a time variable that updates with the loop
current_time = time.time()
#grab an image still from the camera and convert it to grayscale
img01 = cam.getImage().toGray()
#wait half a second
time.sleep(0.05)
#grab an unedited still to use as our original image
original = cam.getImage()
#set webcam image
original.save(streaming)
#grab another image still from the camera and conver it to grayscale
img02 = cam.getImage().toGray()
#subract the images from each other, binarize and inver the colors
diff = (img01 - img02).binarize(50).invert()
#dump all the values into a Numpy matrix and extract the mean avg
matrix = diff.getNumpy()
mean = matrix.mean()
#find and highlight the objects within the image
blobs = diff.findBlobs()
#if the mean is greater than our threshold variable, then look for objects
if mean >= threshold:
#check to see if any objects were detected
if blobs:
#find the central point of each object
#and draw a red circle around it
for b in blobs:
try:
loc = (b.x,b.y) #locates center of object
original.drawCircle(loc,b.radius(),Color.RED,2)
except:
e = sys.exc_info()[0]
#use the current date to create a unique file name
timestr = time.strftime("%H%M%S")
#initialize the counter variable
i = 1
#check to see if the filename already exists
while os.path.exists("pic/motion%s-%s.png" % (timestr, i)):
#if it does, add one to the filename and try again
i += 1
#once a unique filename has been found, save the image
original.save(dst + "/motion%s-%s.png" % (timestr, i))
#print results to terminal
print("Motion Detected")
f = urllib.urlopen("https://autoremotejoaomgcd.appspot.com/sendmessage?key=" + autoremotekey + "&message=" + autoremotemessage)
print("Message Send " + f.read())
open autoremote and follow your link (goo.gl/xxxx)
once you have opened the link you will notice the url say something like key=xxxxx
paste the key inside autoremotekey = ""
save the script by typing ctrl+x
run the python script by typing
Code:
python camera.py
now your camera server should be running ,if you move in front of the camera you should see a output of motion detected
Create The Task
The Task can be whatever you want to run when the camera detects motion in my case I have it play your dongeon is under attack then open the camera viewer. but for the purpose of this tutorial we are going to make it just open the camera.
Open Tasker
Press the TASKS Tab
Press The +
Give The Task A Name Like Camera
Press The +
Click Net
Click Browse URL
Enter the Ip address of your computer(ifconfig) followed by :1212 (192.168.1.12:1212)
Press the back button to save
Press the +
Press Task
Press Wait
adjust the slider to one minute so we don’t get bombarded with messages
press back twice to save configuration and task
Create The Profile
Press the profiles tab
Press the + Button to add a new profile
Select State
Select Plugin
Select Autoremote
Press the Configuration pencil
Check Event Behavior
Message Filter type Motion Detected
press back twice to save
click the newly created task

How to use tasker to open up the power menu?

I'm installing a nexus 7 (2013) into the dash of my car. I'd like to have a widget on my home screen to pull up the original power menu. I've been told there is a way to do it with tasker and running a shell script. If anyone could help me it would be greatly appreciated.
You can use AutoInput plugin, it can do what you ask for. Just create an action, select the AutoInput plugin, and: Plugin > AutoInput > Global Action > Power Dialog.
Another way by you can do that and also will be more customizable (you could add or remove power actions by default) is taking first a screenshot of the powermenu pop-up, then edit it on any image editor like: Photoshop, GIMP. . . And at last take the edited image into the phone again, and use this modified screenshot as your powermenu pop-up with a scene.
This is what I did on one of my anti-theft tasks, and I'm happy with my custom power menu dialog
sendevent /dev/input/event5 1 116 1
sendevent /dev/input/event5 0 0 0
usleep 500000
sendevent /dev/input/event5 1 116 0
sendevent /dev/input/event5 0 0 0
to be run in a shell-task, root
'ks123', the code you provided us is generic. Will be necessary to adjust it to our device.
You're right
it should be .../event2 on the Nexus ...
More info:
http://stackoverflow.com/questions/26204766/simulating-combination-of-key-presses-from-adb-terminal

Categories

Resources