tag:blogger.com,1999:blog-70464929006406273522024-03-20T08:12:33.719-07:00Bennys Technology workroomBenjamin LinnikAnonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-7046492900640627352.post-51133418120865906752016-03-03T11:52:00.001-08:002018-07-22T13:43:30.680-07:00[Android+Windows+GoogleCardboard+Skyrim]A breeze of what a Oculus Rift could feel like<div dir="ltr" style="text-align: left;" trbidi="on">
In July 2016 we will have the Oculus Rift available on the market. Virtual reality glasses which will open a whole new experience for gamers, movie watchers and travelers all over the world. The current shipping price is <a href="https://shop.oculus.com/en-us/cart/" target="_blank">599$ in the pre-order shop</a>.<br />
<br />
If you want to have a breeze of that experience right now and don't want to wait, this guide is for you!<br />
<br />
This will be not a classical Tasker guide, but a friend of mine pushed me to write about my experience so here it is:<br />
<br />
What hardware do we need:<br />
<ul style="text-align: left;">
<li>An Android Smartphone</li>
<li>A Windows computer (Propably also works on a MAC or on a LINUX machine)</li>
<li>A Google cardboard or something similar, look here: <a href="http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2050601.m570.l1311.R1.TR12.TRC2.A0.H0.XGoogle+Cardb.TRS0&_nkw=google+cardboard&_sacat=0" target="_blank">"Google Cardboard" at ebay.com</a> (from 2$ with shipping) </li>
</ul>
What software?<br />
<ul style="text-align: left;">
<li>Android App <a href="https://play.google.com/store/apps/details?id=com.loxai.trinus.test" target="_blank">Trinus VR lite </a>and the Windows counterpart from the <a href="http://trinusvr.com/download-2/" target="_blank">Trinus download page.</a></li>
<li>A software to make Skyrim (or any other game) stereoscopic, get the 14 day Trial version of <a href="https://www.tridef.com/cart/product.php?productid=3" target="_blank">TriDef</a> here. Unfortunately I couldn't get <a href="http://www.mtbs3d.com/start-here/getting-started" target="_blank">Vireio Perception</a> running, that would be great, as this software is for free.</li>
<li>Skyrim (Or propably any other game? Star Citizen, Call of Duty, Battlefield?)</li>
</ul>
Install all the needed software. The order doesn't matter as they don't interfere.<br />
<br />
A few things to account for in Skyrim:<br />
<ul style="text-align: left;">
<li>Mods are <span style="color: #274e13;">OK</span></li>
<li><span style="color: #cc0000;">Disable </span>ENB</li>
</ul>
<br />
Start <a href="https://www.tridef.com/cart/product.php?productid=3" target="_blank">TriDef</a><br />
Start Skyrim<br />
Start <a href="https://play.google.com/store/apps/details?id=com.loxai.trinus.test" target="_blank">Trinus VR lite </a>and connect to your PC.<br />
That's it!<br />
<ul style="text-align: left;">
</ul>
<ul style="text-align: left;">
</ul>
<br />
<ul style="text-align: left;">
</ul>
</div>
Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com0tag:blogger.com,1999:blog-7046492900640627352.post-70476572054421772172015-07-27T18:30:00.003-07:002015-08-09T01:22:50.671-07:00[Tasker] Better battery save widget - "periodic internet": 1%/hr<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #444444;">It's been a while. But I'm back :) So sorry for not replying to all comments.</span><br />
<span style="color: #444444;"><br /></span>
<span style="color: #444444;">Many things changed... I updated my Note 3 to Lollipop (feels good, looks bad), bought a smartwatch (LG Watch R, great battery life due to the <span class="st">OLED </span>display, but not really stable connection to the Google Watch software, but that should be Googles fault, still working on a fix for this). Lost my xposed framework functionality due to the new ART framework and my odexed official ROM, but thats off topic ^^</span><br />
<span style="color: #444444;"><br /></span>
<span style="color: #444444;">I really wonder, who needs a smartphone 7 mm thick with a battery life of 1 day, if one could have instead one, which is 1 cm thick, a little heavier, but a battery life of 3 days. I would hate it, if the new Samsung Galaxy Note 5 would come without an exchangeable battery..... Anyway, as thinner means "better" for customers (grrrr) we have to deal with it. Here is my newest battery saving widget!</span><br />
<span style="color: #444444;"><br /></span>
<span style="color: #444444;">I know, there are programs like "Juice defender" out there. But I don't like overloaded software I have not full control of, running in the background, using RAM and CPU time. </span><br />
<br />
<h3 style="text-align: left;">
It is much more stable (can run for hours and hours) then my previous approaches and I lose approximately 1% of battery per hour.</h3>
<br />
What will you get:<br />
A small widget on your home screen, you click on. It will:<br />
<ul style="text-align: left;">
<li>START </li>
<li>Wait 1,5 minute</li>
<li>Activate flight mode (or only deactivate data and wifi)</li>
<li>Wait 15 minuts</li>
<li>Deactivate airplane mode (or turn data and wifi on)</li>
<li>GOTO START</li>
</ul>
Thats it... It works better, then the previous approaches, because we will use the Tasker Timer option for repeating the task. That means, that it doesn't block other Tasker tasks while running.<br />
<br />
This is how it will look like, look at the icon in the lower left corner (oh and hover the screenshot):<br />
<br /></div>
<div style="text-align: center; width: 350px;">
<a href="https://www.blogger.com/blogger.g?blogID=7046492900640627352" onmouseout="MM_swapImgRestore();document.getElementById('change').innerHTML='Off';" onmouseover="MM_swapImage('Image3','','https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhg6aTQzBjqDZ93oHnfEnDJtrqlxfvjTt4ndOTw-YpWINYoNxJoOYU0Vu180IIJc_FvV-kL5ca7e0ym8rLt1F1xEm2QLnIbHpfV7iadtMvOloSo9IBvCNj1_4YwAeRSlNoucpkr-IeAkbID/s400/2015-07-27+23.54.03.png',1);document.getElementById('change').innerHTML='On';"><img border="0" id="Image3" name="Image3" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp7ui7BL-ISPsqtM06tDkoeIhuajyd07jPhF83UX0SHw5lA8OSxRV5KJVMVvmjpHrK1EPRVgoPiFDzWgfLXjOaCs51tsvxhY1ftCaYdsYDFIv9pC7QENnXXdfAC85_HBcwAo6hucPCBD2V/s400/2015-07-27+23.53.43.png" />
</a><br />
<span id="change">Off</span>
</div>
What do you need: <br />
<ul style="text-align: left;">
<li>For the icons (optional):<a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.ipack.crystalhd&hl=en" target="_blank"> Ipack / Crystal Project HD</a> and <a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.ipack.kyotuxaeonhd&hl=en" target="_blank">Ipack / Kyo-Tux Aeon HD</a></li>
<li>For turning airplane mode on and off (optional): <a href="https://play.google.com/store/apps/details?id=com.intangibleobject.securesettings.plugin&hl=en" target="_blank">Secure Settings</a> <span style="color: #990000;">if you have <b>ROOT </b>access<span style="color: black;"> (<a href="http://www.androidcentral.com/root" target="_blank">HowTo Root</a>), if you don't have ROOT, you can still continue to read - instead of toggling airplane mode, you can toggle DATA and WIFI with Tasker, no need for </span></span><span style="color: #990000;"><span style="color: black;">Secure Settings, maybe you prefer this anyway, the benefit is, you can still be called while in energy saving mode.</span></span></li>
<li><a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm&hl=en" target="_blank"><span style="color: #990000;"><span style="color: black;">Tasker</span></span></a></li>
<li><span style="color: #990000;"><span style="color: black;">20 minutes of life time<span style="color: #b45f06;"> <b>(scroll down for direct downloads)</b></span></span></span></li>
</ul>
So lets start with the profile and the associated task:<br />
<br />
Create a new profile in Tasker, call it "Periodic Internet Widget Off". This profile will be activated, if we click on the notification while the energy saving mode is running. It will deactivate the energy saving mode.<br />
<br />
<div class="mycodes">
<pre><b>Profile: Periodic Internet Widget Off</b>
Event: Notification Click [ Owner Application:Tasker Title:Periodic internet Widget ]
Enter: Periodic internet Widget Off
Abort Existing Task
A1: Stop [ With Error:Off Task:Periodic Internet ]
<span style="color: red;"> A2: Secure Settings [ Configuration:Airplane Mode Disabled Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ]</span></pre>
<pre> A3: Mobile Data [ Set:On ] If [ %MOBILDATA ~ 1 ]
A4: WiFi [ Set:On ] If [ %WLANTMP ~ 1 ]
A5: Notify Cancel [ Title:Periodic internet Widget Warn Not Exist:Off ]
A6: Variable Set [ Name:%PERIRADIO To:0 Do Maths:Off Append:Off ]
A7: Profile Status [ Name:Periodic Internet Widget Off Set:Off ]
A8: Timer Widget Control [ Name:Periodic Internet Type:Reset ]
A9: [X] Timer Widget Control [ Name:Periodic Internet Type:End ]
A10: Set Widget Icon [ Name:Periodic Internet Icon:ipack:kyotuxaeonhd:network_offline_alt ]
A11: Timer Widget Set [ Name:Periodic Internet Seconds:1 Minutes:0 Hours:0 Days:0 ]
</pre>
</div>
<br />
<br />
Now we nee a task to do the actual work. So create this task: <br />
<div class="mycodes">
<pre><b>Task name: Periodic internet Widget On</b>
Abort Existing Task
A1: Variable Set [ Name:%PERIRADIO To:1 Do Maths:Off Append:Off ]
A2: Variable Set [ Name:%MOBILDATA To:1 Do Maths:Off Append:Off ] If [ %AIR ~ off ]
A3: Variable Set [ Name:%MOBILDATA To:0 Do Maths:Off Append:Off ] If [ %AIR !~ off ]
A4: Variable Set [ Name:%WLANTMP To:1 Do Maths:Off Append:Off ] If [ %WIFII ~R CONNECTION ]
A5: Variable Set [ Name:%WLANTMP To:0 Do Maths:Off Append:Off ] If [ %WIFII !~R CONNECTION ]
A6: Variable Set [ Name:%noradio To:%MOBILDATA+%WLANTMP Do Maths:On Append:Off ]
A7: If [ %noradio ~ 0 ]
A8: Stop [ With Error:Off Task: ]
A9: End If
A10: Timer Widget Set [ Name:Periodic Internet Seconds:0 Minutes:15 Hours:0 Days:0 ]
A11: Timer Widget Control [ Name:Periodic Internet Type:Resume ]
</pre>
</div>
<br />
<br />
The last task looks like this:
<br />
<div class="mycodes">
<pre><b>Task name: Periodic Internet</b>
A1: Timer Widget Set [ Name:Periodic Internet Seconds:0 Minutes:15 Hours:0 Days:0 ]
A2: Set Widget Icon [ Name:Periodic Internet Icon:android.resource://net.dinglisch.android.ipack.crystalhd/drawable/quick_restart ]
A3: Notify [ Title:Periodic internet Widget Text: Icon:android.resource://net.dinglisch.android.ipack.crystalhd/drawable/quick_restart Number:%SCRON Permanent:On Priority:2 ]
A4: Profile Status [ Name:Periodic Internet Widget Off Set:On ]
<span style="color: red;"> A5: Secure Settings [ Configuration:Airplane Mode Disabled Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ]</span>
A6: Wait [ MS:0 Seconds:30 Minutes:0 Hours:0 Days:0 ]
A7: WiFi [ Set:On ]
A8: Mobile Data [ Set:On ]
A9: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
<span style="color: red;"> A10: Secure Settings [ Configuration:Airplane Mode Enabled Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ] </span>
</pre>
</div>
<br />
<span style="color: #cc0000;">Add the red lines only, if you have ROOT and want to toggle airplane mode.</span><br />
<br />
<h4 style="text-align: left;">
<span style="color: #cc0000;"><span style="color: black;">You can download and import the tasks directly without the hassle here:</span></span></h4>
<pre><a href="https://docs.google.com/uc?export=download&id=0B45yjcrZHPBZeVVoblJkN19ZTjA"><b>Profile: Periodic Internet Widget Off</b></a></pre>
<pre><a href="https://docs.google.com/uc?export=download&id=0B45yjcrZHPBZOUdQZU5rNFFrY28"><b>Task name: Periodic internet Widget On</b></a></pre>
<pre><a href="https://docs.google.com/uc?export=download&id=0B45yjcrZHPBZbFR2RVhNSnVoYlk"><b>Task name: Periodic Internet</b></a></pre>
<span style="color: #cc0000;"><span style="color: black;"><br /></span></span>
<span style="color: #cc0000;"><span style="color: black;">To see how to import them, skim this article: <a href="http://almost-a-technocrat.blogspot.de/2013/04/how-to-import-tasker-projects-profiles.html#.VbbYyfnIYn8" target="_blank">How to import Tasker projects, profiles, tasks and scenes </a></span></span><br />
<br />
<h4 style="text-align: left;">
<span style="color: #cc0000;"><span style="color: black;">Now we need to create the widget to actually start our "periodic internet" mode.</span></span></h4>
<ol style="text-align: left;">
<li><span style="color: #cc0000;"><span style="color: black;"> Add a "<b>Tasker Timer Task</b>" to your home screen.</span></span></li>
<li><span style="color: #cc0000;"><span style="color: black;">As the task to run select:</span></span><b> "Periodic Internet"</b>.</li>
<li>Set the countdown to<b> 0:0:0:1 (One second) </b>and activate<b> Repeat ON</b></li>
</ol>
<div>
The periodic internet mode should start immediately<b>. </b>Don't forget, it will take 1,5 minutes, until the wifi/data or airplane mode is activated for the first time.<br />
To deactivate the "periodic internet" mode,<b> </b>you should click on the permanent notification in the notification bar.<br />
<div>
<b></b><br />
<span style="color: #cc0000;"><span style="color: black;">Hope it helps You :) <br />Leave your opinion in the comments!</span></span><br />
<br /></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com2tag:blogger.com,1999:blog-7046492900640627352.post-83105619098277348462013-08-02T18:08:00.000-07:002013-08-02T19:35:21.769-07:00[Tasker] Extreme battery saving profile
The battery life of an android phone is not impressive and we got used to charge our phones every day. Nevertheless it can happen that one finds himself in a situation with no charger in reach and no battery left. This profile will help you to avoid this situation. This profile will fire when your battery level will drop under 8% automatically. It is a drastic step, think twice before using it.<br />
This task will:
<br />
<ul>
<li>Put your phone into flight mode (I warned you, drastical steps ;)</li>
<li>Set the display brightness to deep Darth Vader like darkness</li>
</ul>
Yes, you won't be reachable. But you can switch off the flight mode whenever you wish and still send or receive the important messages you would miss otherwise. In my opinion it's better then finding your phone completely drained without any options left. The phone should last minimum another hour in this mode.<br />
You will need:
<br />
<ul>
<li>Tasker</li>
<li><a href="https://play.google.com/store/apps/details?id=com.haxor" target="_blank">Screen filter</a></li>
</ul><br />
This is what my profile looks like:
<div class="mycodes">
<pre>Profile: Extreme battery save (28)
State: Battery Level [ From:0 To:8 ]
Enter: Extreme battery save (3)
A1: Auto Brightness [ Set:Off ]
A2: Display Brightness [ Level:0 Disable Safeguard:Off Ignore Current Level:Off Immediate Effect:On ]
A3: Load App [ App:Screen Filter Data: Exclude From Recent Apps:Off ]
A4: Airplane Mode [ Set:On ]
A5: Notify LED [ Title:Battery low Text:Battery under %BATT percent!
Will switch to battery saving mode. Icon:ipack:crystalhd:cache Number:%BATT Colour:Red Rate:1000 Priority:3 ]
A6: Zoom Visibility [ Element:Extreme battery save.w / StateON Set:On ]
</pre>
</div>
<br />
The normal mode profile could look like this and be activated when a power source is connected:<br />
<div class="mycodes">
<pre>Profile: Power source connected (11)
State: Power [ Source:Any ]
Enter: Energy save (17)
B1: Notify Cancel [ Title:Battery low Warn Not Exist:Off ]
B2: Airplane Mode [ Set:Off ]
B3: Display Brightness [ Level:128 Disable Safeguard:Off Ignore Current Level:Off Immediate Effect:On ]
B4: Auto Brightness [ Set:On ]
B5: Zoom Visibility [ Element:Extreme battery save.w / StateON Set:Off ]
B6: Run Shell [ Command:am force-stop com.haxor Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
</pre>
</div>
<br />
The line B6 kills the screen filter app if it is running and will do nothing if it's not running. To create it go to Script -> Run shell -> and enter the command <i>am force-stop com.haxor</i> :) The downside of this powerful command is, it needs root. Maybe you can get the same result by setting up the action App -> Kill App -> Screen filter. No guarantee on this.<br />
You should have problems with creating lines A6 and B5 yet, as there is no Zoom widget yet. So... stay with me after the commercial break....<br />
<br />
...your ads here...
<br /><br />
<div><div style="text-align: center; width: 350px; float:right">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaXQd7R3-PsGuR_ZJHMP4DqTKdwvc5onku8VtvN_1sNI0eifLlNDKbIfLWWypshxjqPOO7FOQy7tATP4teROpZ1vbLBH94yXgd3THu_TVrtLcDNgUb812BF5arI6yvtj2qLtPOYlbXo4R2/s200/EnergysaveOn.png" onmouseout="MM_swapImgRestore();document.getElementById('changeEnergy').innerHTML='Off';" onmouseover="MM_swapImage('Image2','','https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaXQd7R3-PsGuR_ZJHMP4DqTKdwvc5onku8VtvN_1sNI0eifLlNDKbIfLWWypshxjqPOO7FOQy7tATP4teROpZ1vbLBH94yXgd3THu_TVrtLcDNgUb812BF5arI6yvtj2qLtPOYlbXo4R2/s200/EnergysaveOn.png',1);document.getElementById('changeEnergy').innerHTML='On';" target="_blank"><img border="0" id="Image2" name="Image2" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK1v3EbYvtPfn42HB8J8mIW1jZOt_5c6iy2FgBzU0ezJ46HztzlMpCVjFyva5m4V3W30zh3BqNpM-K_TAanFHMwmxetFCT84FDLUG4he3TIe1FpEVPewra0yE_tAYfWpFVnpGYYre9C2a3/s200/EnergysaveOff.png" />
</a><br />
<span id="changeEnergy">Off</span>
</div>
Again there is a widget to switch this on and off from the home screen dynamically.<br />
My widget looks like this, you will need two icon packs and the app <i>Zoom</i> to get the same result:<br />
<ul>
<li><a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.zoom" target="_blank">Zoom</a></li>
<li><a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.ipack.crystalhd" target="_blank">Ipack / Crystal Project HD</a></li>
<li><a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.ipack.transparentglasshd" target="_blank">Ipack / Transparent Glass HD</a></li>
</ul><br />
</div>
More information on Zoom and how to setup cool widgets can be found on google and <a href="http://technologyworkroom.blogspot.de/2013/05/tasker-energy-saving-mode.html#widget">here</a>.<br />
Import my Zoom profile by saving the <a href="javascript:expandcollapse('energy-saving-mode-widget')">following file as "Extreme_battery_save.w.ztl.xml"</a> under sdcard/Zoom/templates. Then open Zoom and press menu key -> Browse Templates -> Import Directory -> Extreme_battery_save.w.ztl.xml. Now create this Zoom 1x1 widget on your home screen.
<span class="posthidden" id="energy-saving-mode-widget">
<div class="mycodes">
<pre>
<class name="Template" index="">
<backColour>#00000000</backColour>
<borderColour>#FFFFFFFF</borderColour>
<borderWidth>0</borderWidth>
<cellData>180,187,0,0;186,130,0,0</cellData>
<cellsHigh>1</cellsHigh>
<cellsWide>1</cellsWide>
<marginWidth>4</marginWidth>
<name>Extreme battery save.w</name>
<class name="Element" index="elements0">
<elementType>Image</elementType>
<heightLand>199</heightLand>
<heightPort>178</heightPort>
<name>StateOFF1</name>
<visible>true</visible>
<widthLand>159</widthLand>
<widthPort>159</widthPort>
<xLand>0</xLand>
<xPort>0</xPort>
<yLand>0</yLand>
<yPort>0</yPort>
<class name="ImageElement" index="state0">
<alpha>255</alpha>
<stateName></stateName>
<uri>ipack://net.dinglisch.android.ipack.transparentglasshd/lightning2_sc48</uri>
</class>
</class>
<class name="Element" index="elements1">
<elementType>Image</elementType>
<heightLand>199</heightLand>
<heightPort>178</heightPort>
<name>StateOFF</name>
<visible>true</visible>
<widthLand>159</widthLand>
<widthPort>159</widthPort>
<xLand>0</xLand>
<xPort>0</xPort>
<yLand>0</yLand>
<yPort>0</yPort>
<class name="ImageElement" index="state0">
<alpha>255</alpha>
<stateName></stateName>
<uri>ipack://net.dinglisch.android.ipack.transparentglasshd/lightning2_sc48</uri>
<class name="TaskAction" index="onClick0">
<name>Extreme battery save</name>
</class>
</class>
</class>
<class name="Element" index="elements2">
<elementType>Image</elementType>
<heightLand>199</heightLand>
<heightPort>178</heightPort>
<name>StateON</name>
<visible>false</visible>
<widthLand>159</widthLand>
<widthPort>159</widthPort>
<xLand>0</xLand>
<xPort>0</xPort>
<yLand>0</yLand>
<yPort>0</yPort>
<class name="ImageElement" index="state0">
<alpha>200</alpha>
<stateName></stateName>
<uri>ipack://net.dinglisch.android.ipack.crystalhd/cache</uri>
<class name="TaskAction" index="onClick0">
<name>Energy save</name>
</class>
</class>
</class>
</class>
</pre>
</div>
</span>
Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com6tag:blogger.com,1999:blog-7046492900640627352.post-88350022963143741182013-08-02T17:53:00.002-07:002013-08-02T20:06:36.683-07:00[Tasker] How to force a loud alarm on SMS / emergency SMSIf an SMS which contains (notice the "*") the text <i>WAKEUP!</i> comes in, your phone will alert you - no matter what. It's pretty hard to turn this alert off too ^^", you will have to stop the task.<br /><br />
The profile description:<br />
<div class="mycodes">
<pre>
Profile: Emergency SMS (72)
Event: Received Text [ Type:Any Sender:* Content:*WAKEUP!* ]
Enter: Alarm! (71)
Run Both Together
A1: Play Ringtone [ Type:Alarm Sound:Ticktac alarm Stream:4 ]
</pre>
</div>
<br />
Please notice the type when selecting the ringtone, the stream must be set to <i>Alarm</i>. Here the same as a profile to <a href="javascript:expandcollapse('EmergencySMS')">import directly:</a><br />
<span class="posthidden" id="EmergencySMS">
<div class="mycodes">
<pre>
<TaskerData sr="" dvi="1" tv="4.1u3m">
<Profile sr="prof72" ve="2">
<cdate>1353613002541</cdate>
<clp>true</clp>
<edate>1375490668033</edate>
<id>72</id>
<mid0>71</mid0>
<nme>Emergency SMS</nme>
<Event sr="con0" ve="2">
<code>7</code>
<pri>0</pri>
<Int sr="arg0" val="0"/>
<Str sr="arg1" ve="3"/>
<Str sr="arg2" ve="3">WAKEUP!</Str>
</Event>
</Profile>
<Task sr="task71">
<cdate>1353612708197</cdate>
<edate>1374917997002</edate>
<id>71</id>
<nme>Alarm!</nme>
<pri>10</pri>
<rty>2</rty>
<Action sr="act0" ve="3">
<code>192</code>
<Int sr="arg0" val="0"/>
<Str sr="arg1" ve="3">Ticktac alarm</Str>
<Int sr="arg2" val="4"/>
</Action>
</Task>
</TaskerData>
</pre>
</div>
</span>Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com4tag:blogger.com,1999:blog-7046492900640627352.post-349882931809801212013-08-02T05:26:00.001-07:002013-08-18T16:50:14.409-07:00[Tasker] Take pictures of intruders and send them per mail silentlyThis script will detect when someone enters the wrong unlock code or swipes the wrong pattern and sends a picture to an E-Mail address in the background, silently.<br />
For some reason it works better with long patterns and even better with long pin codes. I don't know why. If you know it, let me know :)<br />
<br />
Let's start, please get:
<ul>
<li>Tasker</li>
<li><a href="https://play.google.com/store/apps/details?id=com.intangibleobject.securesettings.plugin" target="_blank">Secure Settings</a> (To setup a profile in Tasker which detects wrong unlock codes)</li>
<li><a href="http://code.google.com/p/python-for-android/downloads/detail?name=PythonForAndroid_r5.apk">Python for Android</a> (To run python code)</li>
<li><a href="http://code.google.com/p/android-scripting/downloads/detail?name=sl4a_r6.apk&can=2&q=">SL4A</a> (To run the python script from Tasker)</li>
<li>The python script <a href="http://tasker.wikidot.com/local--files/sl4a/sendemailA.py">"SendEmailA.py"</a> from the Tasker Wiki. (Send an E-Mails silently)</li>
<li>GoogleMail address</li>
</ul>
Open the Python for Android application, make sure it is not Python3. Press install button to install the Python runtime environment.<br />
Open SL4A and run the "hello_world.py" script by tapping on it and selecting the leftmost terminal icon. Congratulations, you successfully installed Python and can run Python scripts from Tasker!<br />
<br />
<a href="javascript:expandcollapse('SendEmailA')">
Here is my "SendEmailA.py" script.</a> It has a small modification to the original file which is marked in red.
<span class="posthidden" id="SendEmailA">
<div class="mycodes">
<pre>
import os
import glob
import mimetypes
from email import encoders
from email.mime.audio import MIMEAudio
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def attach_files(msg, attachements):
for attachment in attachments:
attachment = attachment.strip()
for path in glob.glob(attachment):
filename = os.path.basename(path)
if not os.path.isfile(path):
continue
# Guess the content type based on the file's extension. Encoding
# will be ignored, although we should check for simple things like
# gzip'd or compressed files.
ctype, encoding = mimetypes.guess_type(path)
if ctype is None or encoding is not None:
# No guess could be made, or the file is encoded (compressed), so
# use a generic bag-of-bits type.
ctype = 'application/octet-stream'
maintype, subtype = ctype.split('/', 1)
if maintype == 'text':
fp = open(path)
# Note: we should handle calculating the charset
part = MIMEText(fp.read(), _subtype=subtype)
fp.close()
elif maintype == 'image':
fp = open(path, 'rb')
part = MIMEImage(fp.read(), _subtype=subtype)
fp.close()
elif maintype == 'audio':
fp = open(path, 'rb')
part = MIMEAudio(fp.read(), _subtype=subtype)
fp.close()
else:
fp = open(path, 'rb')
part = MIMEBase(maintype, subtype)
part.set_payload(fp.read())
fp.close()
# Encode the payload using Base64
encoders.encode_base64(part)
# Set the filename parameter
part.add_header('Content-Disposition', 'attachment', filename=filename)
msg.attach(part)
def sendemail(email_name, email_user, email_pswd, mailto, subject, body, attachments):
import smtplib
# DON'T CHANGE THIS!
# ...unless you're rewriting this script for your own SMTP server!
smtp_server = 'smtp.gmail.com'
smtp_port = 587
# Build an SMTP compatible message
msg = MIMEMultipart()
msg['Subject'] = subject
msg['To'] = mailto
msg['From'] = email_name + " <" + email_user + ">"
msg.attach(MIMEText(body, 'plain'))
attach_files(msg, attachments)
# Attempt to connect and send the email
try:
smtpObj = '' # Declare within this block.
# Check for SMTP over SSL by port number and connect accordingly
if( smtp_port == 465):
smtpObj = smtplib.SMTP_SSL(smtp_server,smtp_port)
else:
smtpObj = smtplib.SMTP(smtp_server,smtp_port)
smtpObj.ehlo()
# StartTLS if using the default TLS port number
if(smtp_port == 587):
smtpObj.starttls()
smtpObj.ehlo
# Login, send and close the connection.
smtpObj.login(email_user, email_pswd)
smtpObj.sendmail(email_user, mailto, msg.as_string())
smtpObj.close()
return 1 # Return 1 to denote success!
except Exception, err:
# Print error and return 0 on failure.
print err
return 0
import sys
import android
droid = android.Android()
try:
email_name = droid.getIntent().result[u'extras'][u'%EMAIL_NAME']
except:
email_name = ''
try:
email_user = droid.getIntent().result[u'extras'][u'%EMAIL_USER']
except:
droid.makeToast('EMAIL_USER missing')
sys.exit(1)
try:
email_pswd = droid.getIntent().result[u'extras'][u'<font color="#ff0000">%mailp</font>']
except:
droid.makeToast('EMAIL_PSWD missing')
sys.exit(1)
try:
mailto = droid.getIntent().result[u'extras'][u'%EMAIL_TO']
except:
droid.makeToast('EMAIL_TO missing')
sys.exit(1)
try:
subject = droid.getIntent().result[u'extras'][u'%EMAIL_SUBJECT']
except:
subject = ''
try:
body = droid.getIntent().result[u'extras'][u'%EMAIL_BODY']
except:
body = ''
try:
attachments = droid.getIntent().result[u'extras'][u'%EMAIL_ATTACH']
attachments = attachments.split(',')
except:
attachments = ''
# Send email
if (sendemail(email_name, email_user, email_pswd, mailto, subject, body, attachments)):
sys.exit(0)
else:
# Exit with error if email is not sent successfully
droid.makeToast('email failed')
sys.exit(1)
</pre>
</div>
</span><br />
<br />
Save this file to your internal SDCard in the SL4A scripts folder (f.e. SDCard\SL4A\Scripts).<br />
<br />
The preparation is done, lets go to Tasker. Create a new profile name it "Security Glitch" or something less obvious. Goto State -> Plugin -> Secure Settings. Click on the Edit field near configuration and select the condition "Failed Login Attempts". Type in a low number, like two. Enable "Device Admin". Read and accept the dialog. Click on save in the lower left corner. Hit the back button and create a new Task, name it "Cheeeese" or similar.<br />
Here is my Cheeeese task:
<div class="mycodes">
<pre>
Cheeeeese (45)
Stay Awake
<font color="#6666ff">A1: Vibrate [ Time:200 ]</font>
A2: Mobile Data [ Set:On ]
A3: WiFi [ Set:On ]
A4: Variable Add [ Name:%PHOTONUMBER Value:1 Wrap Around:0 ]
A5: Take Photo [ Camera:Front Filename:%PHOTONUMBER Naming Sequence:None Insert In Gallery:Off Discreet:On Resolution:320x240 Scene Mode:Auto White Balance:Auto Flash Mode:Auto ]
A6: Wait [ MS:0 Seconds:3 Minutes:0 Hours:0 Days:0 ]
A7: Load Image [ Source:/sdcard/DCIM/Tasker/%PHOTONUMBER.jpg ]
A8: Rotate Image [ Direction:Right Degrees:90 ]
A9: Save Image [ File:/sdcard/DCIM/Tasker/%PHOTONUMBER.jpg Image Quality:70 Delete From Memory After:On ]
A10: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A11: Variable Set [ Name:%EMAIL_USER To:<font color="#660066">mygooglename@gmail.com</font> Do Maths:Off Append:Off ]
<font color="#6666ff">A12: Variable Set [ Name:%EMAIL_P To:<font color="#660066">MyCleartextPassword</font> Do Maths:Off Append:Off ]</font>
<font color="#6666ff">A13: Variable Convert [ Name:%EMAIL_P Function:Base64 Encode Store Result In:%EMAIL_P ]</font>
A13: Variable Convert [ Name:%EMAIL_P Function:Base64 Decode Store Result In:%mailp ]
A14: Variable Set [ Name:%EMAIL_TO To:<font color="#660066">myemailtosendto@domain.com</font> Do Maths:Off Append:Off ]
A15: Variable Set [ Name:%EMAIL_ATTACH To:/sdcard/DCIM/Tasker/%PHOTONUMBER.jpg Do Maths:Off Append:Off ]
A16: Run SL4A Script [ Name:SendEmailA.py Terminal:Off Pass Variables:%EMAIL_USER,%mailp,%EMAIL_TO,%EMAIL_ATTACH Continue Task After Error:On ]
<font color="#6666ff">A17: Vibrate [ Time:616 ]</font>
</pre>
</div>
<br />
And here you can see the profile as an xml to directly import into Tasker, save it as <a href="javascript:expandcollapse('SecurityGlitch')">
SecurityGlitch.prf.xml</a>.
<span class="posthidden" id="SecurityGlitch">
<div class="mycodes">
<pre>
<TaskerData sr="" dvi="1" tv="4.1u3m"><br/> <Profile sr="prof44" ve="2"><br/> <cdate>1353285745747</cdate><br/> <edate>1376868760042</edate><br/> <flags>1</flags><br/> <id>44</id><br/> <mid0>45</mid0><br/> <nme>Security Glitch</nme><br/> <pri>10</pri><br/> <State sr="con0"><br/> <code>11820</code><br/> <Bundle sr="arg0"><br/> <Vals sr="val"><br/> <com.intangibleobject.securesettings.plugin.extra.BLURB>Failed Login Attempts - Max: 2</com.intangibleobject.securesettings.plugin.extra.BLURB><br/> <com.intangibleobject.securesettings.plugin.extra.BLURB-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.BLURB-type><br/> <com.intangibleobject.securesettings.plugin.extra.MAX_LOGIN_FAILURES>2</com.intangibleobject.securesettings.plugin.extra.MAX_LOGIN_FAILURES><br/> <com.intangibleobject.securesettings.plugin.extra.MAX_LOGIN_FAILURES-type>java.lang.Integer</com.intangibleobject.securesettings.plugin.extra.MAX_LOGIN_FAILURES-type><br/> <com.intangibleobject.securesettings.plugin.extra.SETTING>max_failed_pass_attempts</com.intangibleobject.securesettings.plugin.extra.SETTING><br/> <com.intangibleobject.securesettings.plugin.extra.SETTING-type>java.lang.String</com.intangibleobject.securesettings.plugin.extra.SETTING-type><br/> <com.twofortyfouram.locale.intent.extra.BLURB>Failed Login Attempts - Max: 2</com.twofortyfouram.locale.intent.extra.BLURB><br/> <com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type><br/> <net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled><br/> <net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type><br/> </Vals><br/> </Bundle><br/> <Str sr="arg1" ve="3">com.intangibleobject.securesettings.plugin</Str><br/> <Str sr="arg2" ve="3">Secure Settings</Str><br/> </State><br/> </Profile><br/> <Task sr="task45"><br/> <cdate>1353285761891</cdate><br/> <edate>1375520404009</edate><br/> <id>45</id><br/> <nme>Cheeeeese</nme><br/> <pri>10</pri><br/> <stayawake>true</stayawake><br/> <Action sr="act0" ve="3"><br/> <code>61</code><br/> <on>false</on><br/> <Int sr="arg0" val="200"/><br/> </Action><br/> <Action sr="act1" ve="3"><br/> <code>433</code><br/> <Int sr="arg0" val="1"/><br/> </Action><br/> <Action sr="act10" ve="3"><br/> <code>547</code><br/> <Str sr="arg0" ve="3">%EMAIL_USER</Str><br/> <Str sr="arg1" ve="3">yourlogin@gmail.com</Str><br/> <Int sr="arg2" val="0"/><br/> <Int sr="arg3" val="0"/><br/> </Action><br/> <Action sr="act11" ve="3"><br/> <code>596</code><br/> <Str sr="arg0" ve="3">%EMAIL_P</Str><br/> <Int sr="arg1" val="25"/><br/> <Str sr="arg2" ve="3">%email_p</Str><br/> </Action><br/> <Action sr="act12" ve="3"><br/> <code>547</code><br/> <Str sr="arg0" ve="3">%EMAIL_TO</Str><br/> <Str sr="arg1" ve="3">receivermail@domain.com</Str><br/> <Int sr="arg2" val="0"/><br/> <Int sr="arg3" val="0"/><br/> </Action><br/> <Action sr="act13" ve="3"><br/> <code>547</code><br/> <Str sr="arg0" ve="3">%EMAIL_ATTACH</Str><br/> <Str sr="arg1" ve="3">/sdcard/DCIM/Tasker/%PHOTONUMBER.jpg</Str><br/> <Int sr="arg2" val="0"/><br/> <Int sr="arg3" val="0"/><br/> </Action><br/> <Action sr="act14" ve="3"><br/> <code>112</code><br/> <se>false</se><br/> <Str sr="arg0" ve="3">sendemailA.py</Str><br/> <Int sr="arg1" val="0"/><br/> <Str sr="arg2" ve="3">%EMAIL_USER,%email_p,%EMAIL_TO,%EMAIL_ATTACH</Str><br/> </Action><br/> <Action sr="act15" ve="3"><br/> <code>61</code><br/> <on>false</on><br/> <Int sr="arg0" val="616"/><br/> </Action><br/> <Action sr="act2" ve="3"><br/> <code>425</code><br/> <Int sr="arg0" val="1"/><br/> </Action><br/> <Action sr="act3" ve="3"><br/> <code>888</code><br/> <Str sr="arg0" ve="3">%PHOTONUMBER</Str><br/> <Int sr="arg1" val="1"/><br/> <Int sr="arg2" val="0"/><br/> </Action><br/> <Action sr="act4" ve="3"><br/> <code>101</code><br/> <Int sr="arg0" val="1"/><br/> <Str sr="arg1" ve="3">%PHOTONUMBER</Str><br/> <Int sr="arg2" val="0"/><br/> <Int sr="arg3" val="0"/><br/> <Int sr="arg4" val="1"/><br/> <Str sr="arg5" ve="3">320x240</Str><br/> <Int sr="arg6" val="0"/><br/> <Int sr="arg7" val="0"/><br/> <Int sr="arg8" val="0"/><br/> </Action><br/> <Action sr="act5" ve="3"><br/> <code>30</code><br/> <Int sr="arg0" val="0"/><br/> <Int sr="arg1" val="3"/><br/> <Int sr="arg2" val="0"/><br/> <Int sr="arg3" val="0"/><br/> <Int sr="arg4" val="0"/><br/> </Action><br/> <Action sr="act6" ve="3"><br/> <code>188</code><br/> <Img sr="arg0" ve="2"><br/> <var>/sdcard/DCIM/Tasker/%PHOTONUMBER.jpg</var><br/> </Img><br/> </Action><br/> <Action sr="act7" ve="3"><br/> <code>191</code><br/> <Int sr="arg0" val="1"/><br/> <Int sr="arg1" val="1"/><br/> </Action><br/> <Action sr="act8" ve="3"><br/> <code>187</code><br/> <Str sr="arg0" ve="3">/sdcard/DCIM/Tasker/%PHOTONUMBER.jpg</Str><br/> <Int sr="arg1" val="70"/><br/> <Int sr="arg2" val="1"/><br/> </Action><br/> <Action sr="act9" ve="3"><br/> <code>30</code><br/> <Int sr="arg0" val="0"/><br/> <Int sr="arg1" val="2"/><br/> <Int sr="arg2" val="0"/><br/> <Int sr="arg3" val="0"/><br/> <Int sr="arg4" val="0"/><br/> </Action><br/> <Img sr="icn" ve="2"><br/> <nme>yummy_6</nme><br/> <pkg>net.dinglisch.android.ipack.iconedenthemeshd</pkg><br/> </Img><br/> </Task><br/></TaskerData><br/>
</pre>
</div>
</span><br />
<br />
Please make sure the folder "/sdcard/DCIM/Tasker/" exists and you have the right information filled in in the <font color="#660066">purple fields</font>. You can put a file named <i>.nomedia</i> into the DCIM/Tasker/ folder to make sure, it is not displayed in the gallery.<br />
If you don't know how to setup a specific action, please google it. Line A16 is very important. To create this line goto Script -> RunSL4A Script -> in the name field select the "SendEmailA.py" file. Don't check the Terminal field, but fill in the Pass Variable field with <i>%EMAIL_USER,%mailp,%EMAIL_TO,%EMAIL_ATTACH</i>. The order is important. Check continue task after error.<br /><br />
You can delete the <font color="#6666ff">bright blue</font> lines after running the Task once successfully. Please note, that your Google Mail password is stored as a global variable in Tasker Base64 encoded - but it is not a safe encryption! If you have suggestions on how to store the password encrypted n Tasker, please tell me!<br />
<br />
Run the task a few time to check if your device vibrates twice (short vibrate at the beginning and a long vibrate at the end. Check your myemailtosendto@domain.com mails, don't forget to look into the spam folder. If you received a picture exit Tasker, lock your device, count to ten and check by entering the wrong unlock code/pattern a few time. Maybe you can make the profile run with a higher priority, not necessary. If everything went well and you received the beautiful pictures of yourself delete the <font color="#6666ff">bright blue</font> lines.<br />Uninformatively there is an android limitation which will show the SL4A icon for a second in the notification bar when the email is send... I tried to make python run without SL4A, but was not successful yet. A workaround could be to make the icon transparent...<br /><br />
I wrote this down pretty fast, please forgive me if something is unclear. I will refresh this post soon.Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com56tag:blogger.com,1999:blog-7046492900640627352.post-67556295386845591612013-07-29T03:35:00.001-07:002016-11-24T07:09:55.228-08:00[Tasker] Be informed about software progress<div dir="ltr" style="text-align: left;" trbidi="on">
I got my phone repaired and started programming again.<br />
<br />
Here my newest script result:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwQspYMXAbOmntD_m4CX_CPvTov9vOhA27lA1bs8PN6DVpWXN3D9wf-6iWKFFX8YDHLArxtfgIhsS4E55rkARcVDoviCmQqgMtmObGkSY8H_o6ZeUWx8HUNrZiGdF_5CgNGq-fJgwqH_kn/s1600/2013-07-29+12.08.1822.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="151" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwQspYMXAbOmntD_m4CX_CPvTov9vOhA27lA1bs8PN6DVpWXN3D9wf-6iWKFFX8YDHLArxtfgIhsS4E55rkARcVDoviCmQqgMtmObGkSY8H_o6ZeUWx8HUNrZiGdF_5CgNGq-fJgwqH_kn/s640/2013-07-29+12.08.1822.png" width="640" /></a></div>
<br />
Its shows the progress of an automated measurement system (Done by me with <a href="http://www.autoitscript.com/site/autoit/" target="_blank">AutoIt</a>, but that's a different story, think of <a href="http://www.autoitscript.com/site/autoit/" target="_blank">AutoIt</a> as Tasker for Windows - give it a try and the developers and huge thanks :D ).<br />
<br />
Why I need this? <br />
I'm currently working with <a href="http://eil.unipv.it/eil/?q=node/24" target="_blank">CMOS MAPS</a> (<b>M</b>onolithic <b>A</b>ctive <b>P</b>ixel <b>S</b>ensors). They need to be programmed and we measure different parameters after setting a huge amount of settings... This takes a lot of time and effort. The runs take much time and if the system breaks down one looses expensive measurement time. So its a huge benefit to run the whole procedure automatically, as it should be running 24/7 and one needs to know as soon as possible, that something went wrong.<br />
<br />
The system is called MABS as it is a <b>M</b>imosa <b>A</b>utomation <b>B</b>ot <b>S</b>ystem ;)<br />
<br />
But that's not the point. The point is this tiny notification in your Android pulldown menu!<br />
<br />
So basically your Android phone is capable of getting the progress and error/warning statuses of every software you programmed! The setup is very easy. I will post it here soon (this week)! Stay tuned and sorry for not posting in the last time. I promise to improve ;)<br />
<br />
<br /></div>
<a href="http://www.dpg-verhandlungen.de/year/2014/conference/frankfurt/part/hk/session/46/contribution/64">Automated measurements system named MABS</a>Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com7tag:blogger.com,1999:blog-7046492900640627352.post-29441366241227897472013-06-10T19:43:00.000-07:002013-08-02T20:07:35.094-07:00[Tasker] Todo list<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7wXrKduFoQbyI5srqnaomtEtoq_-YjdLhHtaNk9jK51k0xV9O5rgSWRYdctjHqTiZ4Yp8369mNrot8lcHioCCQKSZwAF2K3u0ZC7P64NFqGW45EAXTA5lntBZcdQPrKLX0_2VeM275A-_/s1600/helicon.gif" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7wXrKduFoQbyI5srqnaomtEtoq_-YjdLhHtaNk9jK51k0xV9O5rgSWRYdctjHqTiZ4Yp8369mNrot8lcHioCCQKSZwAF2K3u0ZC7P64NFqGW45EAXTA5lntBZcdQPrKLX0_2VeM275A-_/s1600/helicon.gif" /></a></div>
<h4>
Which Tasker tasks I'm going to post soon: </h4>
<ul>
<li><strike>React to content of WhatsApp messages in Tasker</strike></li>
<li><strike>Sync data between different android devices and display in one synced widget</strike></li>
<li><strike>Configure an emergency message which will force the phone to make a loud sound, even in silent mode</strike></li>
<li><strike>Boot computer when coming home</strike></li>
<li><strike>Less energy expensive accurate GSM based location checks</strike></li>
<li><strike>Extreme energy saving mode (only 1% battery usage per hour)</strike></li>
<li>Extract information from different websites and display it compact in one scene</li>
<li>Force reconnection to automatically deactivated WiFi networks</li>
<li>Create a widget which displays the last WhatsApp an SMS messages of a chosen person</li>
<li>Create a slick widget which takes spy photos without any notification or other evidence</li>
<li>Make a Jarvis like assistant (Iron Man)</li>
</ul>
Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com14tag:blogger.com,1999:blog-7046492900640627352.post-71917897519447938932013-06-10T19:10:00.002-07:002013-08-02T19:06:48.867-07:00[Tasker] Make Tasker read aloud all incoming notifications and messages<div dir="ltr" style="text-align: left;" trbidi="on">
Okay, this one is pretty simple, but still impressive. And that's how a good idea should be, right?<br />
The title says it all, Tasker shall read aloud all the incoming notifications, including SMS, missed calls and if you followed <a href="http://technologyworkroom.blogspot.de/2013/05/tasker-how-to-read-out-whatsapp.html">my previous WhatsApp guide</a> even complete incoming WhatsApp messages.
<br />
<br />
All you have to do is to create this profile and task:
<br />
<div class="mycodes">
<pre>Profile: Notification Read
Event: Notification [ Owner Application:* Title:* ]
State: Variable Value [ Name:%DRIVE Op:Matches Value:1 ]
Enter: Notification Read
A1: Say [ Text:%NTITLE Engine:Voice:default:en Stream:3 Pitch:4 Speed:4 Continue Task Immediately:Off ]
</pre>
</div>
<br />
<br />
Thats it! After you set the global variable %DRIVE to 1 you have your own drive mode!<br />
Of course you can place a beatiful widget on your homescreen to do so (hover me):<br />
<br />
<div style="text-align: center; width: 350px;">
<a href="" onmouseout="MM_swapImgRestore();document.getElementById('change').innerHTML='Off';" onmouseover="MM_swapImage('Image1','','https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIxK5R6gXAd5XdSiqjRSoKKyw7KLzr4Dv6sI-CeeMBG2WoMtdlxI9girujZmvbMO8APihIZGz0hlg63vSok7bCVVgUPEsoyTv2dDksFrQZWbFkLdMS5swTNqooqFbubV6VKs6cEQlh0aH6/s320/On.jpg',1);document.getElementById('change').innerHTML='On';"><img border="0" id="Image1" name="Image1" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyIJyhUPzFC1MEH5B0leevOWGeaBeNGC0tFB4UhQzJyxJ9CqlRH3afjS8pc26tHhDW2t9b5unqHvPolZx-1rcOUZJIzMnQ5ztDTc2dTJTJssX9YkJm0d3rStnaik94ZKS5u_8x_u4S06mS/s320/Off.jpg" />
</a><br />
<span id="change">Off</span>
</div>
<br />
<br />
<h3>
The On/Off widget</h3>
We need another Tasker task to set the global variable to 1 and 0. The task can look like this:
<br />
<div class="mycodes">
<pre>Driver Mode
A1: If [ %DRIVE ~ 1 ]
A2: Variable Set [ Name:%DRIVE To:0 Do Maths:Off Append:Off ]
A3: Zoom Element Visibility [ Element:Driver Mode.w / StateON Set:Off ] // You cannot create this yet! Wait till Zoom widget on homescreen.
A4: Else
A5: Variable Set [ Name:%DRIVE To:1 Do Maths:Off Append:Off ]
A6: Media Volume [ Level:10 Display:Off Sound:Off ]
A7: Zoom Element Visibility [ Element:Driver Mode.w / StateON Set:On ] // You cannot create this yet! Wait till Zoom widget on homescreen.
A8: Say [ Text:Allright, notification-read loaded! Engine:Voice:default:en Stream:3 Pitch:4 Speed:4 Continue Task Immediately:Off ]
A9: End If
</pre>
</div>
<br />
Now we need the widget. Let's make this widget with <a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.zoom" target="_blank">Zoom</a>. Create a widget like described in the previous post "Energy saving mode" in chapter <a href="http://technologyworkroom.blogspot.de/2013/05/tasker-energy-saving-mode.html#widget">The "periodic internet On/Off" widget</a>. The only differences are the name of the widget, the Task to execute and the images to use. I named the widget and the task to execute <i>Driver mode</i>. Notice, that for ON and OFF we execute here the same task defined above. The adorable Pacman graphic can be found in the <a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.ipack.ilikebuttonshd">I Like Buttons HD icon pack</a>. Use a lower alpha value, <a href="http://technologyworkroom.blogspot.de/2013/05/tasker-energy-saving-mode.html#widget">as described here</a>, to get the transparent look when the driver mode is set to OFF. Add the Zoom widget to your home screen and don't forget to add lines A3 and A7 to your <i>Driver mode</i> task. <br />
<br />
I'm still working on this driver mode and hopefully can present soon a solution to answer WhatsApp messages, SMS and phone calls hands free by using the Tasker <i>Get speech</i> action. Have fun!</div>
Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com14tag:blogger.com,1999:blog-7046492900640627352.post-27418728022205548082013-06-10T18:07:00.003-07:002013-06-10T18:08:22.705-07:00[Tasker] How to make accurate location checks without GPS or WiFiTasker has a nice option build in to check for locations. I found, that this method was not very reliable when no GPS was activated. Here I want to present an idea of location checks only with GSM cell info, no internet connection, WiFi or GPS needed. In my opinion it is the most energy conserving method possible.<br />
<br />
Create a new profile, name it <i>Home GSM</i> for example. As the trigger select <i>State </i>-> <i>Phone </i>-> <i>Cell Near</i>. Press scan and take a walk inside you domesticity. Take your time, your phone scans for near GSM cells and measures there signal strength, this information is used to triangulate your position. When you think you are done, go back and create a new Task, name it <i>Home On</i>. Inside of it set a new variable %HOME to 1. Exit the newly created profile and add en exit task, name it <i>Home Off</i> and set the global variable %HOME to 0. You are done. Your profile should look like this:<br />
<div class="mycodes">
<pre>
Profile: Home GSM
State: Cell Near [ Cell Tower / Last Signal:
GSM:1234.56789 / 0
GSM:1234.57719 / 2
Ignore Cells:* ]
Enter: Home On
A1: Variable Set [ Name:%HOME To:1 Do Maths:Off Append:Off ]
Exit: Home Off
A1: Variable Set [ Name:%HOME To:0 Do Maths:Off Append:Off ]
</pre>
</div><br />
<br />
Now we create a second profile, this one will check whether you are home for sure. Create a profile <i>Check Home</i>, it should be activated when the variable %HOME is set to 1. Create a new task, name it <i>Check Home</i>, inside of it place a wait for 1 or 2 minutes. After that place an if clause and check, whether the variable %HOME is still set to 1. If so, you are probably at home! To be even more sure, place another wait for 1 minute and afterwards another <i>if</i> to check if the cells near you match the pattern at your home. Make sure to set the <i>collision handling</i> of the task to <i>Abort new Task</i> and the <i>cool down time</i> to, lets say, 120 seconds in the <i>Task Properties</i>. Your finished task could look like this:
<div class="mycodes">
<pre>
Profile: Check Home
Priority: 5 CoolDown: 120
Event: Variable Set [ Variable:%HOME Value:1 ]
Enter: Check Home
A1: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A2: If [ %HOME ~ 1 ]
A3: Variable Set [ Name:%OUTSIDE To:0 Do Maths:Off Append:Off ]
A4: Notify Sound [ Title:Home sweet home! Text: Icon:ipack:iconedenthemeshd:twitter_8 Number:0 Sound File:/system/media/audio/notifications/S_Knock.ogg Priority:3 ]
A5: Perform Task [ Name:WiFi On Stop:Off Priority:5 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: ]
A6: Perform Task [ Name:LOG write Stop:Off Priority:5 Parameter 1 (%par1):Home Parameter 2 (%par2): Return Value Variable: ]
A7: Mobile Data [ Set:Off ]
A8: Ringer Volume [ Level:5 Display:Off Sound:Off ]
A9: Variable Query [ Title:Start PC? Variable:%pcstart Input Type:Numeric / Integer Default:3665 Background Image:Pictures/Wallpaper/hi_tech_texture-wallpaper-1920x1200.jpg Layout:Question Yes No Timeout (Seconds):60 Show Over Keyguard:On ] If [ %WIFII ~R MyHomeWiFiSSID ]
A10: If [ %pcstart ~ 3665 ]
A11: WoL Wake On Lan Wan Settings[ Configuration:Home Package:com.benfinnigan.wol Name:WoL Wake On Lan Wan Settings]
A12: End If
A3: End If
</pre>
</div><br />
As you can see I placed various other tasks I want to be run when I come home inside the if clause. For example I get asked to turn my computer on. I used the free app <a href="https://play.google.com/store/apps/details?id=com.benfinnigan.wol" target="_blank">Wol Wake on Lan Wan from Brobble</a> to do this, as it offers a Tasker plugin. In my actual <i>Check home</i> profile I placed all the got-home-goodness in a separate task I call within the <i>Check home</i> task. This way I can place a 15 minutes <i>wait</i> before asking about booting the computer without interfering with the original <i>Check home</i> task.<br />
<br />
To learn more about Wake-On-Lan Packages and how you can use them to turn your computer on remotely please read one of the numerous guides on the internet, for example the short and nice guide <a href="http://blog.benfinnigan.com/2008/11/wol-wake-on-lan-through-linksys-router.html">HowTo Wake-On-Lan from Brobble</a> and the very good article <a href="http://lifehacker.com/348197/access-your-computer-anytime-and-save-energy-with-wake+on+lan">Access Your Computer Anytime and Save Energy with Wake-on-LAN on lifehacker from Adam Pash</a>.<br />
<br />
I hope some of you find this location check method useful and improve there android experience with this trick :) What tasks do you run automatically when you come home? Leave your ideas in the comments! Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com11tag:blogger.com,1999:blog-7046492900640627352.post-15579692149066437332013-05-25T19:04:00.001-07:002013-05-25T19:07:54.008-07:00[Tasker] How to sync data between devices with TaskerSometimes it's handy to have the same data on both devices, or to inform a device about some status of an other device. I want to show you an easy way to send information from one device to another with Tasker and a small PHP file on a web server.<br />
<br />
What is possible with this?<br />
<ul>
<li>Display the position of another device directly on the home screen within a widget (I use it for this)</li>
<li>React to certain states of another device (like low battery)</li>
<li>Send information from android to computer</li>
</ul>
What do we need?<br />
<ul>
<li>Tasker</li>
<li>Webserver with PHP support</li>
</ul>
On the server side we need a PHP file named "receive.php" with the following content:<br />
<div class="mycodes">
<pre>
<?php
$file = 'received_data.log';
$handle = fopen($file, 'w') or die('Cannot open file: '.$file);
$data = "";
foreach ($_POST as $key => $value)
{
$data = $data.$value."\n";
}
fwrite($handle, $data);
fclose($handle);
print("0");
?>
</pre>
</div><br />
Make sure the file has the permission "rw-rw-r--". This script receives data send through a PHP_POST and writes the passed values into a file called "received_data.log". Values of different POST variables are seperated by a newline.<br />
<br />
Now Tasker needs to send the desired variables to this php file. The important actions are:
<div class="mycodes">
<pre>
Senddata
A1: HTTP Post [
Server:Port:http://myserver.com/mysite/receive.php
Path:
Data / File:data1=hello data2=test data3=%taskervar1 data4=%taskervar2
data5=%taskervar3 data6=%taskervar4 data7=%taskervar5
Cookies:
Timeout:20
Content Type:application/x-www-form-urlencoded
Output File:Tasker/data/senddata.log ]
A2: Read File [ File:Tasker/data/senddata.log To Var:%error ]
A3: Popup [ Title: Text:%error
Background Image:
Layout:
Popup Timeout (Seconds):1
Show Over Keyguard:On ]
</pre>
</div>
In A1 we send the words "hello", "test" and some values stored in the Tasker variables %taskervar1 to %taskervar5 to the PHP script. The PHP script will write the passed values into a new file, each value seperated by a new line. It will return "0" if no errors occurred. So we can check the success of the operation by comparing the local Tasker variable "%error" to "0".<br />
<br />
Of course the sending doesn't succeed always, the phone could have no connection at the moment or the server could be down. I came up with the following solution: Try to send the data five times in a row until one sending succeeds, if none got through - Tasker waits a few minutes and tries again five times to send the data. This procedure is repeated until it succeeds. I created two Tasks for this. One for preparing the data and one to send it.<br />
I will show you an example how to send the last seven lines of a file with this method. The task "Data write" is called with a variable passed to it (stored afterwards in %par1). It appends this value to a file if the value isn't already the last value stored there and sends the last seven lines of the file to the server:
<div class="mycodes">
<pre>
Data write
Run Both Together
A1: If [ %par1 !~ %LASTLOG ]
A2: Variable Set [ Name:%LASTLOG To:%par1 Do Maths:Off Append:Off ]
A3: Run Shell [ Command:tail -n7 /mnt/sdcard/Tasker/log/Blackbox.log Timeout (Seconds):0 Use Root:Off Store Result In:%log ]
A4: Write File [ File:Tasker/log/Blackbox.log Text:%log %TIME %par1 Append:Off Add Newline:On ]
A5: Write File [ File:Tasker/log/BlackboxFull.log Text:%TIME %par1 Append:On Add Newline:Off ]
A6: Zoom Element Visibility [ Element:Protokoll11.w / logs Set:On ]
A7: If [ %AIR !~ on ]
A8: Variable Set [ Name:%num To:1 Do Maths:Off Append:Off ]
<Post>
A9: Perform Task [ Name:Data send Stop:Off Priority:7 Parameter 1 (%par1):%num Parameter 2 (%par2): Return Value Variable:%post_success ]
A10: Wait [ MS:0 Seconds:0 Minutes:3 Hours:0 Days:0 ]
A11: If [ %post_success !~ 1 ]
A12: Wait [ MS:0 Seconds:0 Minutes:8 Hours:0 Days:0 ]
A13: Variable Add [ Name:%num Value:1 Wrap Around:0 ]
A14: Goto [ Type:Action Label Number:1 Label:Post ]
A15: End If
A16: Notify Cancel [ Title:send log Warn Not Exist:Off ]
A17: End If
A18: End If
A19: Return [ Value:1 Stop:On ]
</pre>
</div>
As you can see, it calls a second task which actually sends the information:
<div class="mycodes">
<pre>
Data Send
Abort Existing Task
A1: Delete File [ File:Tasker/log/Blackboxout.log Shred Level:0 Use Root:Off Continue Task After Error:On ]
A2: Run Shell [ Command:tail -n7 /mnt/sdcard/Tasker/log/Blackbox.log Timeout (Seconds):10 Use Root:Off Store Result In:%log ]
A3: Variable Split [ Name:%log Splitter:%NEWLINE Delete Base:Off ]
A4: Variable Set [ Name:%log4 To: Do Maths:Off Append:Off ] If [ %log4 ! Set ]
A5: Variable Set [ Name:%log5 To: Do Maths:Off Append:Off ] If [ %log5 ! Set ]
A6: Variable Set [ Name:%log6 To: Do Maths:Off Append:Off ] If [ %log6 ! Set ]
A7: Variable Set [ Name:%log7 To: Do Maths:Off Append:Off ] If [ %log7 ! Set ]
A8: Variable Set [ Name:%post_ok To:0 Do Maths:Off Append:Off ]
A9: For [ Variable:%num Items:1:5 ]
A10: Variable Set [ Name:%counter To:%par1*10+%num Do Maths:On Append:Off ]
A11: Notify [ Title:sendlog Text:%LASTLOG Icon:ipack:crystalhd:easymoblog Number:%counter Permanent:On Priority:3 ]
A12: HTTP Post [ Server:Port:http://myserver.com/mysite/receive.php
Path:
Data / File:log1=%log1 log2=%log2 log3=%log3
log4=%log4 log5=%log5 log6=%log6 log7=%log7
Cookies:
Timeout:20
Content Type:application/x-www-form-urlencoded
Output File:Tasker/log/Blackboxout.log
Continue Task After Error:On ]
A13: Wait [ MS:0 Seconds:10 Minutes:0 Hours:0 Days:0 ]
A14: Read File [ File:Tasker/log/Blackboxout.log To Var:%post_ok ]
A15: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A16: If [ %post_ok ~ 1 ]
A17: Notify Cancel [ Title:send log Warn Not Exist:Off ]
A18: Return [ Value:1 Stop:On ]
A19: End If
A20: Wait [ MS:0 Seconds:10 Minutes:0 Hours:0 Days:0 ]
A21: End For
A22: Return [ Value:2 Stop:On ]
</pre>
</div>
The global variable %NEWLINE has a newline, a return character stored in it. Please create this one, we need it to separate each new line in the file.<br /><br />
If you are looking for an easier solution to send information directly from one android device to another android device, you should have a look at <a href="https://play.google.com/store/apps/details?id=com.joaomgcd.autoremote">AutoRemote</a>. Unfortunately this feature isn't free.Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com4tag:blogger.com,1999:blog-7046492900640627352.post-87255665024680470352013-05-17T17:31:00.001-07:002015-08-12T09:03:51.156-07:00[Tasker] How to read out WhatsApp messages with Tasker and react on their content in real time<div dir="ltr" style="text-align: left;" trbidi="on">
<h2>
Update2:</h2>
<div>
They changed something since Android 5.<br />
First, one needs a new sqlite3 binary. I found a working one at xda-developers.<br />
Secondary, one has to change the database access terminal command in Tasker from<br />
<br />
<pre><span class="posthidden" id="whatsapp1">sqlite3 /data/data/com.whatsapp/databases/msgstore.db "SELECT timestamp,data,key_remote_jid FROM messages WHERE key_from_me='0' ORDER BY timestamp DESC LIMIT 1;"</span></pre>
<pre><span class="posthidden">
</span></pre>
<div style="text-align: left;">
<span class="posthidden">to</span></div>
<pre><span class="posthidden">
</span></pre>
<pre>cd /data/data/com.whatsapp/databases/;</pre>
<pre><span class="posthidden">sqlite3 msgstore.db "SELECT timestamp,data,key_remote_jid FROM messages WHERE key_from_me='0' ORDER BY timestamp DESC LIMIT 1;"</span></pre>
<pre><span class="posthidden">
</span></pre>
<div style="text-align: left;">
Now it works again. </div>
<div style="text-align: left;">
<span class="posthidden">I will update the post soon and explain the changes in more detail. </span></div>
</div>
<div>
<br /></div>
<h2>
Update:</h2>
If you like this article, you should take a look at this one:<br />
<a href="http://technologyworkroom.blogspot.de/2013/06/taskermake-tasker-read-aloud-all.html">Make Tasker read aloud all incoming notifications and messages</a><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinKmCGReETZ8Az7aLnD1NrXbLmQuNcIj9utbbw4rTftAZRWwSBh6sQ4_Urg-uUteY6zIrOj2qF2XaDZDJFfdx_pQ43sXTUfO0OureFPfcaMHIsu0L7PiShwy_1-bi4U5GWv6_dSTXZ8xB8/s1600/2013-05-03+01.39.35.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="128" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinKmCGReETZ8Az7aLnD1NrXbLmQuNcIj9utbbw4rTftAZRWwSBh6sQ4_Urg-uUteY6zIrOj2qF2XaDZDJFfdx_pQ43sXTUfO0OureFPfcaMHIsu0L7PiShwy_1-bi4U5GWv6_dSTXZ8xB8/s1600/2013-05-03+01.39.35.jpg" width="320" /></a></div>
Tasker can read out incoming or stored WhatsApp Messages, I used Tasker to do the following things on WhatsApp:<br />
<ul>
<li>Display the incoming messages in iOS style, no need to pull down the notification menu to read the messages. The whole message is displayed in the menu bar. See screenshot for details</li>
<li>Play different notification sounds for different contacts or different message content, this way you can for example get a special notification if your name is mentioned.</li>
<li>Mute WhatsApp at specific times or at specific locations, without muting other notifications. </li>
<li><span style="color: #cc0000;">Update: </span><a href="http://technologyworkroom.blogspot.de/2013/06/taskermake-tasker-read-aloud-all.html">Read aloud WhatsApp messages</a></li>
</ul>
What we need:<br />
<ul>
<li>Tasker</li>
<li>WhatsApp </li>
<li>root. I want you to root your phone now! You need root for SQLite, we need it to read out the database of WhatsApp.</li>
<li><a href="https://play.google.com/store/apps/details?id=ptSoft.util.sqlite3forroot" rel="nofollow" target="_blank">SQLite for Android</a></li>
<li><a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.ipack.kyotuxaeonhd" rel="nofollow" target="_blank">Kyo-Tux Aeon HD icon pack</a>, provides useful icons for Tasker, its free and lightweight, so grab it</li>
</ul>
<br />
Here is the complete profile:<br />
<div class="mycodes">
<pre>Profile: WhatsApp Statusbar
Priority: 9 CoolDown: 0
Event: Notification [ Owner Application:WhatsApp Title:* ]
Enter: WhatsApp Notification
Run Both Together
A1: Run Shell [ Command:sqlite3 /data/data/com.whatsapp/databases/msgstore.db "SELECT timestamp,data,key_remote_jid FROM messages WHERE key_from_me='0' ORDER BY timestamp DESC LIMIT 1;" Timeout (Seconds):15 Use Root:On Store Result In:%sql_result Continue Task After Error:On ]
A2: If [ %sql_result !~ %SQL_RESULT_OLD ]
A3: Variable Set [ Name:%SQL_RESULT_OLD To:%sql_result Do Maths:Off Append:Off ]
A4: Variable Split [ Name:%sql_result Splitter:| Delete Base:On ]
A5: Variable Set [ Name:%sql_result1 To:%sql_result1/1000 Do Maths:On Append:Off ]
A6: Variable Convert [ Name:%sql_result1 Function:Seconds to Date Time Store Result In: ]
A7: Variable Split [ Name:%sql_result1 Splitter: Delete Base:Off ]
A8: Variable Search Replace [ Variable:%sql_result12 Search:\. Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In: Replace Matches:On Replace With:: ]
A9: Perform Task [ Name:Number->Name WhatsApp Stop:Off Priority:6 Parameter 1 (%par1):%sql_result3 Parameter 2 (%par2): Return Value Variable:%sql_result3 ]
A10: Wait Until [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ] If [ %sql_result3 !~R @s.whatsapp.net ]
A11: Array Push [ Name:%WHATSAPP_NOTIFY Position:1 Value:%sql_result3: %sql_result2 Fill Spaces:Off ]
A12: Notify Cancel [ Title:%WHATSAPP_NOTIFY4 Warn Not Exist:Off ]
A13: Variable Clear [ Name:%WHATSAPP_NOTIFY4 Pattern Matching:Off ]
A14: Notify [ Title:%sql_result3: %sql_result2 Text:%sql_result2 Icon:ipack:kyotuxaeonhd:buddy_green Number:0 Permanent:Off Priority:3 ]
A15: Perform Task [ Name:Play Sound Stop:Off Priority:6 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: ]
A16: End If
</pre>
</div>
<a href="javascript:expandcollapse('whatsapp1')">
Click here to see the WhatsAppStatusbar.prf.xml you can import directly into Tasker.</a>
<span class="posthidden" id="whatsapp1">
</span><br />
<div class="mycodes">
<pre><span class="posthidden" id="whatsapp1"><TaskerData sr="" dvi="1" tv="1.3.3u2m">
<Profile sr="prof59" ve="2">
<cdate>1353556343390</cdate>
<edate>1368831772583</edate>
<flags>1</flags>
<id>59</id>
<mid0>175</mid0>
<nme>WhatsApp Statusbar</nme>
<pri>9</pri>
<Event sr="con0" ve="2">
<code>461</code>
<pri>1</pri>
<App sr="arg0">
<appClass>com.whatsapp.Main</appClass>
<appPkg>com.whatsapp</appPkg>
<label>WhatsApp</label>
</App>
<Str sr="arg1" ve="3"/>
</Event>
</Profile>
<Task sr="task175">
<cdate>1353556370005</cdate>
<edate>1368831772583</edate>
<id>175</id>
<nme>WhatsApp Message</nme>
<pri>10</pri>
<rty>2</rty>
<Action sr="act0" ve="3">
<code>123</code>
<se>false</se>
<Str sr="arg0" ve="3">sqlite3 /data/data/com.whatsapp/databases/msgstore.db "SELECT timestamp,data,key_remote_jid FROM messages WHERE key_from_me='0' ORDER BY timestamp DESC LIMIT 1;"</Str>
<Int sr="arg1" val="15"/>
<Int sr="arg2" val="1"/>
<Str sr="arg3" ve="3">%sql_result</Str>
</Action>
<Action sr="act1" ve="3">
<code>37</code>
<lhs>%sql_result</lhs>
<op>2</op>
<rhs>%SQL_RESULT_OLD</rhs>
</Action>
<Action sr="act10" ve="3">
<code>355</code>
<Str sr="arg0" ve="3">%WHATSAPP_NOTIFY</Str>
<Int sr="arg1" val="1"/>
<Str sr="arg2" ve="3">%sql_result3: %sql_result2</Str>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act11" ve="3">
<code>779</code>
<Str sr="arg0" ve="3">%WHATSAPP_NOTIFY4</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act12" ve="3">
<code>549</code>
<Str sr="arg0" ve="3">%WHATSAPP_NOTIFY4</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act13" ve="3">
<code>523</code>
<Str sr="arg0" ve="3">%sql_result3: %sql_result2</Str>
<Str sr="arg1" ve="3">%sql_result2</Str>
<Img sr="arg2" ve="2">
<nme>buddy_green</nme>
<pkg>net.dinglisch.android.ipack.kyotuxaeonhd</pkg>
</Img>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act14" ve="3">
<code>130</code>
<Str sr="arg0" ve="3">Play Sound</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="6"/>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
</Action>
<Action sr="act15" ve="3">
<code>38</code>
</Action>
<Action sr="act2" ve="3">
<code>547</code>
<Str sr="arg0" ve="3">%SQL_RESULT_OLD</Str>
<Str sr="arg1" ve="3">%sql_result</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act3" ve="3">
<code>590</code>
<Str sr="arg0" ve="3">%sql_result</Str>
<Str sr="arg1" ve="3">|</Str>
<Int sr="arg2" val="1"/>
</Action>
<Action sr="act4" ve="3">
<code>547</code>
<Str sr="arg0" ve="3">%sql_result1</Str>
<Str sr="arg1" ve="3">%sql_result1/1000</Str>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act5" ve="3">
<code>596</code>
<Str sr="arg0" ve="3">%sql_result1</Str>
<Int sr="arg1" val="4"/>
<Str sr="arg2" ve="3"/>
</Action>
<Action sr="act6" ve="3">
<code>590</code>
<Str sr="arg0" ve="3">%sql_result1</Str>
<Str sr="arg1" ve="3"/>
<Int sr="arg2" val="0"/>
</Action>
<Action sr="act7" ve="3">
<code>598</code>
<Str sr="arg0" ve="3">%sql_result12</Str>
<Str sr="arg1" ve="3">\.</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Str sr="arg5" ve="3"/>
<Int sr="arg6" val="1"/>
<Str sr="arg7" ve="3">:</Str>
</Action>
<Action sr="act8" ve="3">
<code>130</code>
<Str sr="arg0" ve="3">Number-&gt;Name
WhatsApp</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="6"/>
<Str sr="arg3" ve="3">%sql_result3</Str>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3">%sql_result3</Str>
</Action>
<Action sr="act9" ve="3">
<code>35</code>
<lhs>%sql_result3</lhs>
<op>12</op>
<rhs>@s.whatsapp.net</rhs>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="5"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Img sr="icn" ve="2">
<cls>com.whatsapp.Main</cls>
<pkg>com.whatsapp</pkg>
</Img>
</Task>
</TaskerData>
</span></pre>
</div>
<span class="posthidden" id="whatsapp1">
</span>
<br />
<br />
The most important line is A1. Here we use the installed sqlite to save the time, the sender and the content of the last message stored in the WhatsApp database into a Tasker variable. The values are separated by a "|", the time is in ms and the sender is stored as a phone numer. So there are some conversions needed afterwards.<br />
You may have noticed that there is a call to another task at line A9. WhatsApp saves only the number of the contact who send you the message in its database, so we need to convert the number to a real contact name as saved in your phone book. The task "Number->Name WhatsApp" does it. It searches the address book for contacts associated with a WhatsApp account and returns their name. So after line A10 you should know who texted you by name, you can put in if clauses to react different to different names. Here the description of the "Number->Name WhatsApp" task:<br />
<div class="mycodes">
<pre>Number->Name WhatsApp
A1: Run Shell [ Command:sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db "SELECT display_name FROM raw_contacts WHERE sync1 like '%par1';" Timeout (Seconds):5 Use Root:On Store Result In:%sql_result_name Continue Task After Error:On ]
A2: If [ %sql_result_name !~R sql_result_name ]
A3: Return [ Value:%sql_result_name Stop:On ]
A4: Else
A5: Return [ Value:%par1 Stop:On ]
A6: End If
</pre>
</div>
<a href="javascript:expandcollapse('whatsapp2')">
Click here to see the NumberNameWhatsApp.tsk.xml you can import directly into Tasker.</a>
<span class="posthidden" id="whatsapp2">
</span><br />
<div class="mycodes">
<pre><span class="posthidden" id="whatsapp2"><TaskerData sr="" dvi="1" tv="1.3.3u2m">
<Task sr="task60">
<cdate>1355153077534</cdate>
<edate>1357807836858</edate>
<id>60</id>
<nme>Number-&gt;Name WhatsApp</nme>
<pri>10</pri>
<Action sr="act0" ve="3">
<code>123</code>
<se>false</se>
<Str sr="arg0" ve="3">sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db "SELECT display_name FROM raw_contacts WHERE sync1 like '%par1';"</Str>
<Int sr="arg1" val="5"/>
<Int sr="arg2" val="1"/>
<Str sr="arg3" ve="3">%sql_result_name</Str>
</Action>
<Action sr="act1" ve="3">
<code>37</code>
<lhs>%sql_result_name</lhs>
<op>12</op>
<rhs>sql_result_name</rhs>
</Action>
<Action sr="act2" ve="3">
<code>126</code>
<Str sr="arg0" ve="3">%sql_result_name</Str>
<Int sr="arg1" val="1"/>
</Action>
<Action sr="act3" ve="3">
<code>43</code>
</Action>
<Action sr="act4" ve="3">
<code>126</code>
<Str sr="arg0" ve="3">%par1</Str>
<Int sr="arg1" val="1"/>
</Action>
<Action sr="act5" ve="3">
<code>38</code>
</Action>
</Task>
</TaskerData>
</span></pre>
</div>
<span class="posthidden" id="whatsapp2">
</span>
<br />
At line A15 of the task "WhatsApp Notification" task I call a Tasker task called "Play Sound". That's because I disabled notification sounds in WhatsApp to handle them myself (They are time and WhatsApp message content depandant). Here an example of how a simple "Play Sound" task could look like:
<br />
<div class="mycodes">
<pre>Play Sound
Run Both Together
A1: If [ %par1 ~R .*[Rr]+[Uu]+[Aa]+[Rr]+.* ]
A2: Variable Set [ Name:%tmp To:%VOLS Do Maths:Off Append:Off ]
A3: Wait [ MS:50 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A4: System Volume [ Level:7 Display:Off Sound:Off ]
A5: If [ %SILENT ~ off ]
A6: Play Ringtone [ Type:Notification Sound:Dinosaur Roar Stream:1 ]
A7: Else If [ %HEADSET ~ 1 ]
A8: Play Ringtone [ Type:Notification Sound:Dinosaur Roar Stream:1 ]
A9: End If
A10: Vibrate [ Time:1000 ]
A11: Vibrate [ Time:1000 ]
A12: Vibrate [ Time:1000 ]
A13: Vibrate [ Time:1000 ]
A14: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A15: System Volume [ Level:%tmp Display:Off Sound:Off ]
A16: Else If [ %par1 ~R [Mm][Ii][Aa][Uu]+\b ]
A17: If [ %SILENT ~ off ]
A18: Play Ringtone [ Type:Notification Sound:Miau Stream:1 ]
A19: Else If [ %HEADSET ~ 1 ]
A20: Play Ringtone [ Type:Notification Sound:Miau Stream:1 ]
A21: End If
A22: Else
A23: If [ %par2 !~ 1 ]
A24: If [ %HEADSET !~ 1 ]
A25: If [ %SILENT ~ off ]
A26: Vibrate [ Time:100 ]
A27: Play Ringtone [ Type:Notification Sound:Good news Stream:5 ]
A28: End If
A29: End If
A30: End If
A31: End If
</pre>
</div>
<a href="javascript:expandcollapse('whatsapp3')">
Save me as "PlaySound.tsk.xml" and import me in Tasker.</a>
<span class="posthidden" id="whatsapp3">
</span><br />
<div class="mycodes">
<pre><span class="posthidden" id="whatsapp3"><TaskerData sr="" dvi="1" tv="1.3.3u2m">
<Task sr="task176">
<cdate>1353531946878</cdate>
<edate>1368836670797</edate>
<id>176</id>
<nme>Play Sound</nme>
<pri>10</pri>
<rty>2</rty>
<Action sr="act0" ve="3">
<code>37</code>
<lhs>%par1</lhs>
<op>11</op>
<rhs>.*[Rr]+[Uu]+[Aa]+[Rr]+.*</rhs>
</Action>
<Action sr="act1" ve="3">
<code>547</code>
<Str sr="arg0" ve="3">%tmp</Str>
<Str sr="arg1" ve="3">%VOLS</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act10" ve="3">
<code>61</code>
<Int sr="arg0" val="1000"/>
</Action>
<Action sr="act11" ve="3">
<code>61</code>
<Int sr="arg0" val="1000"/>
</Action>
<Action sr="act12" ve="3">
<code>61</code>
<Int sr="arg0" val="1000"/>
</Action>
<Action sr="act13" ve="3">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="5"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act14" ve="3">
<code>308</code>
<Int sr="arg0">
<var>%tmp</var>
</Int>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
</Action>
<Action sr="act15" ve="3">
<code>43</code>
<lhs>%par1</lhs>
<op>11</op>
<rhs>[Mm][Ii][Aa][Uu]+\b</rhs>
</Action>
<Action sr="act16" ve="3">
<code>37</code>
<lhs>%SILENT</lhs>
<op>1</op>
<rhs>off</rhs>
</Action>
<Action sr="act17" ve="3">
<code>192</code>
<Int sr="arg0" val="1"/>
<Str sr="arg1" ve="3">Join Hangout</Str>
<Int sr="arg2" val="1"/>
</Action>
<Action sr="act18" ve="3">
<code>43</code>
<lhs>%HEADSET</lhs>
<op>1</op>
<rhs>1</rhs>
</Action>
<Action sr="act19" ve="3">
<code>192</code>
<Int sr="arg0" val="1"/>
<Str sr="arg1" ve="3">Join Hangout</Str>
<Int sr="arg2" val="1"/>
</Action>
<Action sr="act2" ve="3">
<code>30</code>
<Int sr="arg0" val="50"/>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act20" ve="3">
<code>38</code>
</Action>
<Action sr="act21" ve="3">
<code>43</code>
</Action>
<Action sr="act22" ve="3">
<code>37</code>
<lhs>%par2</lhs>
<op>2</op>
<rhs>1</rhs>
</Action>
<Action sr="act23" ve="3">
<code>37</code>
<lhs>%HEADSET</lhs>
<op>2</op>
<rhs>1</rhs>
</Action>
<Action sr="act24" ve="3">
<code>37</code>
<lhs>%SILENT</lhs>
<op>1</op>
<rhs>off</rhs>
</Action>
<Action sr="act25" ve="3">
<code>61</code>
<Int sr="arg0" val="100"/>
</Action>
<Action sr="act26" ve="3">
<code>192</code>
<Int sr="arg0" val="1"/>
<Str sr="arg1" ve="3">Good news</Str>
<Int sr="arg2" val="5"/>
</Action>
<Action sr="act27" ve="3">
<code>38</code>
</Action>
<Action sr="act28" ve="3">
<code>38</code>
</Action>
<Action sr="act29" ve="3">
<code>38</code>
</Action>
<Action sr="act3" ve="3">
<code>308</code>
<Int sr="arg0" val="7"/>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
</Action>
<Action sr="act30" ve="3">
<code>38</code>
</Action>
<Action sr="act4" ve="3">
<code>37</code>
<lhs>%SILENT</lhs>
<op>1</op>
<rhs>off</rhs>
</Action>
<Action sr="act5" ve="3">
<code>192</code>
<Int sr="arg0" val="1"/>
<Str sr="arg1" ve="3">Flowers</Str>
<Int sr="arg2" val="1"/>
</Action>
<Action sr="act6" ve="3">
<code>43</code>
<lhs>%HEADSET</lhs>
<op>1</op>
<rhs>1</rhs>
</Action>
<Action sr="act7" ve="3">
<code>192</code>
<Int sr="arg0" val="1"/>
<Str sr="arg1" ve="3">Flowers</Str>
<Int sr="arg2" val="1"/>
</Action>
<Action sr="act8" ve="3">
<code>38</code>
</Action>
<Action sr="act9" ve="3">
<code>61</code>
<Int sr="arg0" val="1000"/>
</Action>
<Img sr="icn" ve="2">
<nme>nn_play</nme>
<pkg>net.dinglisch.android.ipack.ilikebuttonshd</pkg>
</Img>
</Task>
</TaskerData>
</span></pre>
</div>
<span class="posthidden" id="whatsapp3">
</span>
<br />
If headphones are connected or phone is on silent mode no sound is played at all. If the message contains something like "Rrruaaarrrr" a dinosaur roar is played at full volume (even with headphones connected) and the phone vibrates for 4 seconds. If a "Miauuu" is in the message a cats miau is played... I'm sure you can do better :)<br />
<br />
You can even make Tasker react on a click on one of the notifications, just add the following profile:
<br />
<div class="mycodes">
<pre>Profile: WhatsApp Notification1 Click
Event: Notification Click [ Owner Application:Tasker Title:%WHATSAPP_NOTIFY1 ]
Enter: Open WhatsApp
A1: Load App [ App:WhatsApp Data: Exclude From Recent Apps:Off ]
</pre>
</div>
Duplicate this profile two times so you can click on any of our three custom notifications.
<br />
<div class="mycodes">
<pre>Profile: WhatsApp Notification2 Click
Event: Notification Click [ Owner Application:Tasker Title:%WHATSAPP_NOTIFY2 ]
Enter: Open WhatsApp
A1: Load App [ App:WhatsApp Data: Exclude From Recent Apps:Off ]
</pre>
</div>
<div class="mycodes">
<pre>Profile: WhatsApp Notification3 Click
Event: Notification Click [ Owner Application:Tasker Title:%WHATSAPP_NOTIFY3 ]
Enter: Open WhatsApp
A1: Load App [ App:WhatsApp Data: Exclude From Recent Apps:Off ]
</pre>
</div>
<br />
<br />
I added another profile which deletes all our custom made WhatsApp notifications automatically after opening WhatsApp. Looks like this:
<br />
<div class="mycodes">
<pre>Profile: WhatsApp opened
Application: WhatsApp
Enter: WhatsApp Notification clear
A1: Notify Cancel [ Title:%WHATSAPP_NOTIFY1 Warn Not Exist:Off ]
A2: Notify Cancel [ Title:%WHATSAPP_NOTIFY2 Warn Not Exist:Off ]
A3: Notify Cancel [ Title:%WHATSAPP_NOTIFY3 Warn Not Exist:Off ]
A4: Variable Clear [ Name:%WHATSAPP_NOTIFY* Pattern Matching:On ]
A5: Stop [ With Error:Off Task:WhatsApp Notification ]
</pre>
</div>
<br />
Have fun and use this knowledge wisely. Please leave your thoughts in the comments, I'm very excited about your implementations. Hope you read this Ruy Aguilar ;)
</div>
Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com56tag:blogger.com,1999:blog-7046492900640627352.post-64266389565226257662013-05-16T18:15:00.000-07:002013-08-02T17:18:11.009-07:00[Tasker] Energy saving modeBattery life isn't great on smartphones these days... So it's no surprise the Nokia 105 was in the news when it was announced earlier this year. It claims to have 30 days of battery life and is sold for only 20$. It would be nice to have a smartphone lasting that long. I will show you an easy way to expand the battery life of an android smartphone with Tasker. Nowadays smartphones are online all the time, radiating information continuously. I noticed that it makes a huge difference in battery life wether I'm connected to a WiFi AP or not. Even data connection (4G/3G/EDGE/GPRS) seems to have a significant impact on the standby time of my phone. Permanently disconnecting from the internet is no solution in the 21. century, you will miss all the notifications, messages and other goodnesses of our information age. A solution I came up with is to connect to the network only once every 14 minutes.<br />
<br />
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAoAeAjBOIC5M_yrmhqEQXDispLi7B8_T281H1ODTiD7tm9Hm4epqG_1Gux2n8QygikIlLuM2xxODTRxbDO7tLoi8l2i9PS1x4JE9uwdAzOoRvDp1YPOG7jEp3pRCp1UsIqsJ3ZkOmwlNF/s320/Screenshot_2013-05-03-01-34-35.png" style="float: right; margin: 0px 0px 0px 20px;" />
Our task, lets call it "periodic internet", will disconnect the phone from the network for 14 minutes, then connect for 1 minute and get all the notifications before starting over again by disconnecting for 14 minutes... All calls and SMS will be received in real time, while all the notifications will be delayed by up to 14 minutes. The benefit is the significantly improved battery life. Because of this task, my phone uses only 2% of the battery per hour! I configured Tasker to run this task while I'm at the gym, or at night when not connected to a power supply. Sometimes I activate it manually, because I know my phone won't make it trough the day otherwise.<br />
<br />
What are we going to do:<br />
<ul>
<li>We will configure a widget on our home screen one can tap to activate and deactivate the "periodic internet" task</li>
<li>We will show a permanent notification while running this task, after clicking the notification the task we be canceled and the permanent internet connection will be restored</li>
<li>The notification will show the time when the phone was connected to the internet the last time and how often the internet has been turned off and on already</li>
</ul>
What do we need:<br />
<ul>
<li>Android phone</li>
<li><a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm">Tasker</a> - create your own small programs</li>
<li><a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.zoom">Zoom</a> - an app able to create interactive widgets, install it after Tasker.</li>
<li><a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.ipack.crystalhd">Crystal Project HD icon pack</a> - we will use one of the icons</li>
<li>10-20 minutes lifetime</li>
</ul>
<br />
<h3>
The "periodic internet On" task</h3>
The task checks which internet connection radios are on, saves them into global variables for later use and turns WiFi and data off for 14 minutes, after that it turns them on for 1 minute before repeating itself by turning them off again. At the beginning of the task a zoom widget is modified, I will explain this later. Moreover a notification informing that the task is running is shown. Skip the line A2, add it later after you have created a "Periodic internet widget" as described later in this post.
<br />
<div class="mycodes">
<pre>Periodic internet On
Abort Existing Task
A1: Variable Set [ Name:%PERIRADIO To:1 Do Maths:Off Append:Off ]
A2: Zoom Element Visibility [ Element:Periodic Radio.w / StateON Set:On ]
A3: Variable Set [ Name:%num To:0 Do Maths:Off Append:Off ]
<Loop>
A4: Anchor
A5: Variable Add [ Name:%num Value:1 Wrap Around:0 ]
A6: Notify [ Title:Periodic internet Text: Icon:ipack:crystalhd:quick_restart Number:%num Permanent:On Priority:3 ]
A7: Variable Set [ Name:%MOBILDATA To:1 Do Maths:Off Append:Off ] If [ %AIR ~ off ]
A8: Variable Set [ Name:%MOBILDATA To:0 Do Maths:Off Append:Off ] If [ %AIR !~ off ]
A9: Variable Set [ Name:%WLANTMP To:1 Do Maths:Off Append:Off ] If [ %WIFII ~R CONNECTION ]
A10: Variable Set [ Name:%WLANTMP To:0 Do Maths:Off Append:Off ] If [ %WIFII !~R CONNECTION ]
A11: Variable Set [ Name:%noradio To:%MOBILDATA+%WLANTMP Do Maths:On Append:Off ]
A12: If [ %noradio ~ 0 ]
A13: Stop [ With Error:Off Task: ]
A14: End If
A15: Mobile Data [ Set:Off ]
A16: WiFi [ Set:Off ]
A17: Wait [ MS:0 Seconds:0 Minutes:14 Hours:0 Days:0 ]
A18: WiFi [ Set:On ] If [ %WLANTMP ~ 1 ]
A19: Mobile Data [ Set:On ] If [ %MOBILDATA ~ 1 ]
A20: Wait [ MS:0 Seconds:0 Minutes:1 Hours:0 Days:0 ]
A21: Goto [ Type:Action Label Number:1 Label:Loop ]</pre>
</div>
<a href="javascript:expandcollapse('energysave1')">
Click here to see the periodicinterneton.tsk.xml you can import directly into Tasker.</a>
<span class="posthidden" id="energysave1">
<br />
<div class="mycodes">
<pre><TaskerData sr="" dvi="1" tv="1.3.3u2m">
<Task sr="task175">
<cdate>1366139544095</cdate>
<edate>1368747046322</edate>
<id>175</id>
<nme>Periodic internet On</nme>
<pri>10</pri>
<rty>1</rty>
<Action sr="act0" ve="3">
<code>547</code>
<Str sr="arg0" ve="3">%PERIRADIO</Str>
<Str sr="arg1" ve="3">1</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act1" ve="3">
<code>721</code>
<Str sr="arg0" ve="3">Periodic internet.w / StateON</Str>
<Int sr="arg1" val="1"/>
</Action>
<Action sr="act10" ve="3">
<code>547</code>
<Str sr="arg0" ve="3">%noradio</Str>
<Str sr="arg1" ve="3">%MOBILDATA+%WLANTMP</Str>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act11" ve="3">
<code>37</code>
<lhs>%noradio</lhs>
<op>1</op>
<rhs>0</rhs>
</Action>
<Action sr="act12" ve="3">
<code>137</code>
<Int sr="arg0" val="0"/>
<Str sr="arg1" ve="3"/>
</Action>
<Action sr="act13" ve="3">
<code>38</code>
</Action>
<Action sr="act14" ve="3">
<code>433</code>
<Int sr="arg0" val="0"/>
</Action>
<Action sr="act15" ve="3">
<code>425</code>
<Int sr="arg0" val="0"/>
</Action>
<Action sr="act16" ve="3">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="14"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act17" ve="3">
<code>425</code>
<lhs>%WLANTMP</lhs>
<op>1</op>
<rhs>1</rhs>
<Int sr="arg0" val="1"/>
</Action>
<Action sr="act18" ve="3">
<code>433</code>
<lhs>%MOBILDATA</lhs>
<op>1</op>
<rhs>1</rhs>
<Int sr="arg0" val="1"/>
</Action>
<Action sr="act19" ve="3">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act2" ve="3">
<code>547</code>
<Str sr="arg0" ve="3">%num</Str>
<Str sr="arg1" ve="3">0</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act20" ve="3">
<code>135</code>
<Int sr="arg0" val="1"/>
<Int sr="arg1" val="1"/>
<Str sr="arg2" ve="3">Loop</Str>
</Action>
<Action sr="act3" ve="3">
<code>300</code>
<label>Loop</label>
</Action>
<Action sr="act4" ve="3">
<code>888</code>
<Str sr="arg0" ve="3">%num</Str>
<Int sr="arg1" val="1"/>
<Int sr="arg2" val="0"/>
</Action>
<Action sr="act5" ve="3">
<code>523</code>
<Str sr="arg0" ve="3">Periodic internet</Str>
<Str sr="arg1" ve="3"/>
<Img sr="arg2" ve="2">
<nme>quick_restart</nme>
<pkg>net.dinglisch.android.ipack.crystalhd</pkg>
</Img>
<Int sr="arg3">
<var>%num</var>
</Int>
<Int sr="arg4" val="1"/>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act6" ve="3">
<code>547</code>
<lhs>%AIR</lhs>
<op>1</op>
<rhs>off</rhs>
<Str sr="arg0" ve="3">%MOBILDATA</Str>
<Str sr="arg1" ve="3">1</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act7" ve="3">
<code>547</code>
<lhs>%AIR</lhs>
<op>2</op>
<rhs>off</rhs>
<Str sr="arg0" ve="3">%MOBILDATA</Str>
<Str sr="arg1" ve="3">0</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act8" ve="3">
<code>547</code>
<lhs>%WIFII</lhs>
<op>11</op>
<rhs>CONNECTION</rhs>
<Str sr="arg0" ve="3">%WLANTMP</Str>
<Str sr="arg1" ve="3">1</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act9" ve="3">
<code>547</code>
<lhs>%WIFII</lhs>
<op>12</op>
<rhs>CONNECTION</rhs>
<Str sr="arg0" ve="3">%WLANTMP</Str>
<Str sr="arg1" ve="3">0</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
</Task>
</TaskerData></pre>
</div></span>
<br />
<br />
<h3>
The "periodic internet Off" task</h3>
This task must be executed to turn the periodic internet mode off. Skip the line A6, code it after adding the "Periodic internet widget" on your home screen:
<br />
<div class="mycodes">
<pre>Periodic internet Off
A1: Stop [ With Error:Off Task:Periodic internet On ]
A2: Mobile Data [ Set:On ] If [ %MOBILDATA ~ 1 ]
A3: WiFi [ Set:On ] If [ %WLANTMP ~ 1 ]
A4: Notify Cancel [ Title:Periodic internet Warn Not Exist:Off ]
A5: Variable Set [ Name:%PERIRADIO To:0 Do Maths:Off Append:Off ]
A6: Zoom Element Visibility [ Element:Periodic internet.w / StateON Set:Off ]</pre>
</div>
<a href="javascript:expandcollapse('energysave2')">
Click here to see the periodicinternetoff.tsk.xml you can import directly into Tasker.</a>
<span class="posthidden" id="energysave2">
<div class="mycodes">
<pre><TaskerData sr="" dvi="1" tv="1.3.3u2m">
<Task sr="task176">
<cdate>1366195609780</cdate>
<edate>1368748409608</edate>
<id>176</id>
<nme>Periodic internet Off</nme>
<pri>10</pri>
<Action sr="act0" ve="3">
<code>137</code>
<Int sr="arg0" val="0"/>
<Str sr="arg1" ve="3">Periodic internet On</Str>
</Action>
<Action sr="act1" ve="3">
<code>433</code>
<lhs>%MOBILDATA</lhs>
<op>1</op>
<rhs>1</rhs>
<Int sr="arg0" val="1"/>
</Action>
<Action sr="act2" ve="3">
<code>425</code>
<lhs>%WLANTMP</lhs>
<op>1</op>
<rhs>1</rhs>
<Int sr="arg0" val="1"/>
</Action>
<Action sr="act3" ve="3">
<code>779</code>
<Str sr="arg0" ve="3">Periodic internet</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act4" ve="3">
<code>547</code>
<Str sr="arg0" ve="3">%PERIRADIO</Str>
<Str sr="arg1" ve="3">0</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act5" ve="3">
<code>721</code>
<Str sr="arg0" ve="3">Periodic internet.w / StateON</Str>
<Int sr="arg1" val="0"/>
</Action>
</Task>
</TaskerData>
</pre>
</div>
</span>
<br />
<br />
<h3>
Turn off "Periodic internet" by clicking on the notification</h3>
Create a new Tasker profile, name it "Periodic internet Off". Select <i>event</i>, <i>UI</i>, <i>notification click</i>. Owner Application is "Tasker" and the title should be "Periodic internet". As the performed action select the just created "Periodic internet Off" task.
<br />
<br />
<a name="widget"></a>
<h3>
The "periodic internet On/Off" widget</h3>
Now we need the above mentioned program "Zoom", this will allow us to place a interactive widget on our home screen so we can turn our new battery saving mode on and off by tapping on it.
Import the widget template by <a href="javascript:expandcollapse('energysave3')">copypasting the following code into a "Periodic_internet.ztl.xml" file</a> or follow the instructions bellow to create a widget yourself.<br />
<span class="posthidden" id="energysave3">
<div class="mycodes">
<pre>
<class name="Template" index="">
<backColour>#00000000</backColour>
<borderColour>#FFFFFFFF</borderColour>
<borderWidth>0</borderWidth>
<cellData>160,200,20,18;212,148,0,0</cellData>
<cellsHigh>1</cellsHigh>
<cellsWide>1</cellsWide>
<marginWidth>4</marginWidth>
<name>Periodic internet</name>
<class name="Element" index="elements0">
<elementType>Image</elementType>
<heightLand>191</heightLand>
<heightPort>191</heightPort>
<name>StateOFF</name>
<visible>true</visible>
<widthLand>151</widthLand>
<widthPort>151</widthPort>
<xLand>0</xLand>
<xPort>0</xPort>
<yLand>0</yLand>
<yPort>0</yPort>
<class name="ImageElement" index="state0">
<alpha>75</alpha>
<stateName></stateName>
<uri>ipack://net.dinglisch.android.ipack.crystalhd/quick_restart</uri>
<class name="TaskAction" index="onClick0">
<name>Periodic internet On</name>
</class>
</class>
</class>
<class name="Element" index="elements1">
<elementType>Image</elementType>
<heightLand>191</heightLand>
<heightPort>191</heightPort>
<name>StateON</name>
<visible>false</visible>
<widthLand>151</widthLand>
<widthPort>151</widthPort>
<xLand>0</xLand>
<xPort>0</xPort>
<yLand>0</yLand>
<yPort>0</yPort>
<class name="ImageElement" index="state0">
<alpha>255</alpha>
<stateName></stateName>
<uri>ipack://net.dinglisch.android.ipack.crystalhd/quick_restart</uri>
<class name="TaskAction" index="onClick0">
<name>Periodic internet Off</name>
</class>
</class>
</class>
</class>
</pre>
</div>
</span>
Start Zoom and tap on the <i>green plus</i> in the lower right corner of the <i>templates</i> register. Configure it like this and tap on the <i>green check</i> button:
<div class="mycodes">
<ul>
<li>name: Periodic internet</li>
<li>cell width x height: 1 x 1</li>
<li>background colour: #00000000</li>
<li>margin width: 0</li>
<li>border width: 0</li>
<li>border colour: #ffffffff</li>
<li>visible: true</li>
</ul>
</div>
Now we will need an image element, therefore long press on the blank black area and select <i>image</i>. Fill in the fields like this:
<div class="mycodes">
<ul>
<li>name: StateOFF</li>
<li>source: select a nice looking icon. I like the "quick_restart" icon from the Crystal Project HD pack, you can see it on the screenshot at the top of this post.</li>
<li>alpha: 75 (that's important)</li>
<li>Click action: select the Tasker task "Periodic internet On"</li>
</ul>
</div>
Accept with the <i>green check</i> button. Long press on the newly created image and select <i>Fit to widget</i>. Now we will create a second image on top of this one. Press the menu button of your phone and select <i>Add element</i>. Select <i>image</i> again but configure it this time like shown here:
<br />
<div class="mycodes">
<ul>
<li>name: StateON</li>
<li>source: select the same nice looking icon</li>
<li>alpha: 255</li>
<li>Click action: select the Tasker task "Periodic internet Off"</li>
</ul>
</div>
After accepting, expand the image again over the whole widget area. You should end up with one image on top of the other, covering it completely. That's perfect, accept again with the <i>green check</i> button. You should see the template window again with a Periodic internet template. Exit Zoom by clicking on the button in left bottom corner (<i>green check</i>).<br /></br>
Now we need to place the widget on our home screen, just add a Zoom 1x1 widget and select the "Periodic internet" template when asked, confirm every dialog. Make sure the Zoom Element Visibility lines in our Tasker tasks (lines A2 and A6 respectively) point to the created "Periodic internet" Zoom widget on your home screen. Check it!<br /><br />
That's it! Now it's your turn - automate the activation and deactivation of the "periodic internet" task, I'm excited to hear about your experience with it! <a href="http://zombo.com/">The only limit is yourself!</a>Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com20tag:blogger.com,1999:blog-7046492900640627352.post-76973196132780944552013-05-12T07:58:00.000-07:002013-05-16T15:05:47.811-07:00[Tasker] Check a website for specific informationOne useful thing Tasker can do is fetch a website and scan it for specific information you are interested in. If the information you are looking for is present, Tasker can notify you and your friends. After clicking on the notification you will be redirected to the information of interest.
<br />
<br />
I want to show you how to check a bargain website like mydealz.de for posts containing the keywords "Kino" (Cinema in German) and "Knaller" (price hit) and notify you and your friends about them. Deals posted with the keyword cinema often contain information on how to get a discount for a certain movie or how to watch it for free. Often the amount of discounted tickets is limited so one has to react quickly to get one. It can be a huge advantage to know about this deals as soon as possible. So lets make Tasker look out for these discounts and inform us about the interesting ones!
<br />
<br />
In principle the task is build like this: We have a global variable which contains all the interesting keywords separated by a semicolon ";". In out example the Variable is called "%WANTED" and has the value "Kino;Knaller". Of cource it can contain more keywords, just separate them correctly. The task downloads the html file of the website by using the HTTP GET command and reads it in into a new local variable %mydealz. Afterwards the variable %mydealz is searched with <a href="http://www.regular-expressions.info/">regular expressions</a> for headings. All the headings are saved in an array. If a keyword occurs in a heading a notification is shown and a SMS is sent to provided numbers.
<br />
<br />
Here the code description:
<br />
<div class="mycodes">
<pre>MyDealz check
A1: Variable Query [ Title:What are the keywords to look for? (Semicolon separated) Variable:%WANTED Input Type:Normal Text Default:SSD;Plasma;House Background Image: Layout:Variable Query Timeout (Seconds):300 Show Over Keyguard:Off ] If [ %WANTED ! Set ]
A2: Variable Set [ Name:%wanted To:%WANTED Do Maths:Off Append:Off ]
A3: Variable Split [ Name:%wanted Splitter:; Delete Base:Off ]
A4: HTTP Get [ Server:Port:www.mydealz.de Path: Attributes: Cookies: Timeout:30 Mime Type:application/octet-stream Output File:Tasker/log/MyDealz.html ]
A5: Read File [ File:Tasker/log/MyDealz.html To Var:%mydealz ]
A6: Variable Search Replace [ Variable:%mydealz Search:<h2>
<a href="http://www.blogger.com/.*">.*</a></h2>
A7: For [ Variable:%element Items:%wanted() ]
A8: For [ Variable:%num Items:%array() ]
A9: If [ %num ~R %element ]
A10: Variable Convert [ Name:%num Function:HTML to Text Store Result In:%mydealztext ]
A11: Variable Search Replace [ Variable:%num Search:".*" Ignore Case:Off Multi-Line:On One Match Only:On Store Matches In:%MYDEALZ_NOTIFY_URL Replace Matches:Off Replace With: ]
A12: Test [ Type:Variable Length Data:%MYDEALZ_NOTIFY_URL1 Store Result In:%urllength ]
A13: Variable Subtract [ Name:%urllength Value:2 ]
A14: Variable Section [ Name:%MYDEALZ_NOTIFY_URL1 From:2 Length:%urllength Adapt To Fit:Off Store Result In:%MYDEALZ_NOTIFY_URL1 ] If [ %MYDEALZ_NOTIFY_URL1 ~R " ]
A15: Variable Convert [ Name:%num Function:To MD5 Digest Store Result In:%num ]
A16: For [ Variable:%allreadyfound Items:%MYDEALZFOUND() ]
A17: If [ %allreadyfound ~ %num ]
A18: Goto [ Type:Action Label Number:1 Label:next ]
A19: End If
A20: End For
A21: Array Push [ Name:%MYDEALZFOUND Position:1 Value:%num Fill Spaces:On ]
A22: Variable Clear [ Name:%MYDEALZFOUND4 Pattern Matching:Off ]
A23: Variable Set [ Name:%MYDEALZ_NOTIFY To:%element bei myDealz Do Maths:Off Append:Off ]
A24: Notify Sound [ Title:%element bei myDealz Text:%mydealztext Icon:ipack:ilikebuttonshd:perspectivebutton_reboot Number:0 Sound File:/system/media/audio/alarms/Serene_morning.ogg Priority:3 ]
A25: Perform Task [ Name:SMS send Stop:Off Priority:5 Parameter 1 (%par1):%element on myDealz: %NEWLINE%mydealztext %MYDEALZ_NOTIFY_URL1 Parameter 2 (%par2):0123456789 Return Value Variable: ]
A26: End If
<next>
A27: Anchor
A28: End For
A29: End For
</pre>
</div>
The task is long, so I provide here a XML file for you to import it directly into Tasker. Just save the file on your phone. Open Tasker, long press on Tasks, choose Import and navigate to the path where you saved the file. Check the imported task.<br />
<br />
You can run the task whenever you want, for example every hour or every time you are connected to a WiFi network. Enjoy and don't miss a deal any more :) <br /><br />
<a href="http://www.file-upload.net/download-7585003/MyDealzCheck.tsk.xml.html">Download</a> or copy paste into a file named "MyDealtCheck.tsk.xml" the following code:
<br />
<a href="javascript:expandcollapse('subtopicID123')">
Click to expand the code</a>
<span class="posthidden" id="subtopicID123">
<div class="mycodes">
<pre><TaskerData sr="" dvi="1" tv="1.3.3u2m">
<Task sr="task170">
<cdate>1358719750905</cdate>
<edate>1368371947116</edate>
<id>170</id>
<nme>MyDealz check</nme>
<pri>10</pri>
<Kid sr="Kid">
<launchID>131</launchID>
<pkg>com.gmail.bennylinnik.mydealzcheck</pkg>
<vnme>1.0</vnme>
<vnum>2</vnum>
</Kid>
<Action sr="act0" ve="3">
<code>595</code>
<lhs>%WANTED</lhs>
<op>10</op>
<rhs></rhs>
<Str sr="arg0" ve="3">What shall I look for?</Str>
<Str sr="arg1" ve="3">%WANTED</Str>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3">SSD;Plasma;Kino</Str>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3">Variable Query</Str>
<Int sr="arg6" val="300"/>
<Int sr="arg7" val="0"/>
</Action>
<Action sr="act1" ve="3">
<code>547</code>
<Str sr="arg0" ve="3">%wanted</Str>
<Str sr="arg1" ve="3">%WANTED</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act10" ve="3">
<code>598</code>
<Str sr="arg0" ve="3">%num</Str>
<Str sr="arg1" ve="3">".*"</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="1"/>
<Int sr="arg4" val="1"/>
<Str sr="arg5" ve="3">%MYDEALZ_NOTIFY_URL</Str>
<Int sr="arg6" val="0"/>
<Str sr="arg7" ve="3"/>
</Action>
<Action sr="act11" ve="3">
<code>115</code>
<Int sr="arg0" val="11"/>
<Str sr="arg1" ve="3">%MYDEALZ_NOTIFY_URL1</Str>
<Str sr="arg2" ve="3">%urllength</Str>
</Action>
<Action sr="act12" ve="3">
<code>890</code>
<Str sr="arg0" ve="3">%urllength</Str>
<Int sr="arg1" val="2"/>
</Action>
<Action sr="act13" ve="3">
<code>597</code>
<lhs>%MYDEALZ_NOTIFY_URL1</lhs>
<op>11</op>
<rhs>"</rhs>
<Str sr="arg0" ve="3">%MYDEALZ_NOTIFY_URL1</Str>
<Int sr="arg1" val="2"/>
<Int sr="arg2">
<var>%urllength</var>
</Int>
<Int sr="arg3" val="0"/>
<Str sr="arg4" ve="3">%MYDEALZ_NOTIFY_URL1</Str>
</Action>
<Action sr="act14" ve="3">
<code>596</code>
<Str sr="arg0" ve="3">%num</Str>
<Int sr="arg1" val="26"/>
<Str sr="arg2" ve="3">%num</Str>
</Action>
<Action sr="act15" ve="3">
<code>39</code>
<Str sr="arg0" ve="3">%allreadyfound</Str>
<Str sr="arg1" ve="3">%MYDEALZFOUND()</Str>
</Action>
<Action sr="act16" ve="3">
<code>37</code>
<lhs>%allreadyfound</lhs>
<op>1</op>
<rhs>%num</rhs>
</Action>
<Action sr="act17" ve="3">
<code>135</code>
<Int sr="arg0" val="1"/>
<Int sr="arg1" val="1"/>
<Str sr="arg2" ve="3">next</Str>
</Action>
<Action sr="act18" ve="3">
<code>38</code>
</Action>
<Action sr="act19" ve="3">
<code>40</code>
</Action>
<Action sr="act2" ve="3">
<code>590</code>
<Str sr="arg0" ve="3">%wanted</Str>
<Str sr="arg1" ve="3">;</Str>
<Int sr="arg2" val="0"/>
</Action>
<Action sr="act20" ve="3">
<code>355</code>
<Str sr="arg0" ve="3">%MYDEALZFOUND</Str>
<Int sr="arg1" val="1"/>
<Str sr="arg2" ve="3">%num</Str>
<Int sr="arg3" val="1"/>
</Action>
<Action sr="act21" ve="3">
<code>549</code>
<Str sr="arg0" ve="3">%MYDEALZFOUND4</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act22" ve="3">
<code>547</code>
<Str sr="arg0" ve="3">%MYDEALZ_NOTIFY</Str>
<Str sr="arg1" ve="3">%element bei myDealz</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act23" ve="3">
<code>538</code>
<Str sr="arg0" ve="3">%element bei myDealz</Str>
<Str sr="arg1" ve="3">%mydealztext</Str>
<Img sr="arg2" ve="2">
<icn>2130837538</icn>
</Img>
<Int sr="arg3" val="0"/>
<Str sr="arg4" ve="3">/system/media/audio/alarms/Serene_morning.ogg</Str>
<Int sr="arg5" val="3"/>
</Action>
<Action sr="act24" ve="3">
<code>41</code>
<Str sr="arg0" ve="3">0123456789</Str>
<Str sr="arg1" ve="3">%element on myDealz:
%mydealztext %MYDEALZ_NOTIFY_URL1</Str>
<Int sr="arg2" val="0"/>
</Action>
<Action sr="act25" ve="3">
<code>38</code>
</Action>
<Action sr="act26" ve="3">
<code>300</code>
<label>next</label>
</Action>
<Action sr="act27" ve="3">
<code>40</code>
</Action>
<Action sr="act28" ve="3">
<code>40</code>
</Action>
<Action sr="act3" ve="3">
<code>118</code>
<Str sr="arg0" ve="3">www.mydealz.de</Str>
<Str sr="arg1" ve="3"/>
<Str sr="arg2" ve="3"/>
<Str sr="arg3" ve="3"/>
<Int sr="arg4" val="30"/>
<Str sr="arg5" ve="3">application/octet-stream</Str>
<Str sr="arg6" ve="3">Tasker/log/MyDealz.html</Str>
</Action>
<Action sr="act4" ve="3">
<code>417</code>
<Str sr="arg0" ve="3">Tasker/log/MyDealz.html</Str>
<Str sr="arg1" ve="3">%mydealz</Str>
</Action>
<Action sr="act5" ve="3">
<code>598</code>
<Str sr="arg0" ve="3">%mydealz</Str>
<Str sr="arg1" ve="3">&lt;h2&gt;&lt;a href=".*"&gt;.*&lt;/a&gt;&lt;/h2&gt;</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Str sr="arg5" ve="3">%array</Str>
<Int sr="arg6" val="0"/>
<Str sr="arg7" ve="3"/>
</Action>
<Action sr="act6" ve="3">
<code>39</code>
<Str sr="arg0" ve="3">%element</Str>
<Str sr="arg1" ve="3">%wanted()</Str>
</Action>
<Action sr="act7" ve="3">
<code>39</code>
<Str sr="arg0" ve="3">%num</Str>
<Str sr="arg1" ve="3">%array()</Str>
</Action>
<Action sr="act8" ve="3">
<code>37</code>
<lhs>%num</lhs>
<op>11</op>
<rhs>%element</rhs>
</Action>
<Action sr="act9" ve="3">
<code>596</code>
<Str sr="arg0" ve="3">%num</Str>
<Int sr="arg1" val="7"/>
<Str sr="arg2" ve="3">%mydealztext</Str>
</Action>
<Img sr="icn" ve="2">
<icn>2130837538</icn>
</Img>
</Task>
</TaskerData>
</pre>
</div>
</span>
Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com1tag:blogger.com,1999:blog-7046492900640627352.post-9520323961018206812013-05-12T04:21:00.001-07:002013-06-30T05:24:29.803-07:00[Tasker] Silent your phone after turning it face down for longer than 10 seconds<h2>Update:</h2>Amjan noticed (see comments below) that this task won't work if you have your "Proximity Sensor watching" not enabled in Tasker, therefore do the following before you start:<br />
Press "menu key" while in Tasker -> "Preferences" -> "Monitor" tab -> Search for the label "Proximity Sensor" and select "Yes".<br /><br />
It is a very simple but also very effective Tasker profile is to silent your phone by turning it face down. Instead of turning it instantly into silent mode I want to show you a way to wait for a certain time before muting it. Therefore you reduce the chance to mute it by accident. <br />
<br />
The trick is to create two Tasker profiles. The first one sets a global variable to 1 when the phone is turned face down and to 0 if its not in this state any more. The second profile is activated when the global variable is changed to 1. In the task the second profile launches there is a wait (f. e. 10 seconds) followed by a check if the global variable is still set to 1. If the check evaluates to true, then the phone is still in <span style="font-family: inherit;">the </span>face down state and it is turned silent.<br />
<br />
Here is the complete code:<br />
<div class="mycodes"><pre>
<h4>Profile: Display down</h4>State: Orientation [ Is:Face Down ]
<br />Enter: Display down on<br /> A1: Variable Set [ Name:%SCRDWN To:1 Do Maths:Off Append:Off ] <br /><br />Exit: Display down off <br /> A1: Variable Set [ Name:%SCRDWN To:0 Do Maths:Off Append:Off ] <br /> A2: If [ %TMPSILENT ~ 1 ]<br /> A3: Silent Mode [ Mode:Off ] <br /> A4: Variable Set [ Name:%TMPSILENT To:0 Do Maths:Off Append:Off ] <br /> A5: End If<br />
<h4>Profile: Turn silent</h4>Event: Variable Set [ Variable:%SCRDWN Value:1 ]
<br />Enter: Silent<br /> A1: Wait [ MS:0 Seconds:10 Minutes:0 Hours:0 Days:0 ] <br /> A2: If [ %SCRDWN ~ 1 ]<br /> A3: If [ %SILENT ~ off ]<br /> A4: Silent Mode [ Mode:On ] <br /> A5: Variable Set [ Name:%TMPSILENT To:1 Do Maths:Off Append:Off ] <br /> A6: End If <br /> A7: End If
</pre></div>
Anonymoushttp://www.blogger.com/profile/07819197229483615829noreply@blogger.com7