yashsingh1/xdaforums huggingface dataset:
[Nexus One Themes and Apps] strictlyrude27:
Here's the script I came up with to do nandroid backups. Perks of using my script rather than brandall's profiles (god bless his soul and peace be upon him):

Tasker profiles are SUPER easy to set up - single action of executing the script, and the profile intent is less obfuscated

ROM and kernel information appended to backup

I'm using CWM4 (and apparently it's not officially supported on my phone, ROM Manager thinks I don't have a recovery), so the line that concerns getting the user's version of CWM doesn't make a lick of difference to me - I could use someone to look over my script and test it out for me; seems to work on sample files I've gotten though.

Credits are to brandall, heywtf, waydownsouth, et al. Thanks for making this work possible!

#!/system/bin/sh

# nandroid.sh
# Written by: strictlyrude27
# strictlyrude27@gmail.com
# Date: 22 July 2011
#
# This script reboots your device into recovery mode and performs a Nandroid
# backup - the name of the backup is [date-time_rom_kernel]. This requires super-
# user permissions to run. Execute it in shell or via Locale Execute Plugin
# (either via Tasker or Locale).
#
# Acknowledgements:
# brandall (http://goo.gl/ejhov)
# - for developing the original Tasker Nandroid profile scheme
# (original scheme at http://goo.gl/s9mp9)
# heywtf, waydownsouth, et al
# - "If I have seen a little further, it is by standing on the shoulders
# of giants." --Isaac Newton
#
# CHANGELOG
# 8/7 - cleaning up the script nicely thanks to waydownsouth's input!
# 7/22 - initial release

settingsfile=/sdcard/clockworkmod/.settings
cmdfile=/cache/recovery/extendedcommand
last_log=/cache/recovery/last_log

# Build time/date, ROM, kernel information
thetime=`date +%F-%I.%M.%S%P`
kernel=`uname -r`

rom=`getprop ro.modversion | sed 's/CyanogenMod/CM/'`

# test for last_log first...
if [ -e $last_log ]; then
cwm=`sed -n 's/.*ClockworkMod Recovery v\([0-9]\).*/\1/p' $last_log`
elif [ -e $settingsfile ]; then
cwm=`sed 's/.*recovery_version":"\([0-9]\).*/\1/' $settingsfile`
fi

cwm=${cwm:-3}

if [ "$cwm" -le 2 ]; then
cat > $cmdfile<<EOF
print "Tasker Nandroid Backup: ${thetime} ${rom} ${kernel}"
backup_rom /sdcard/clockworkmod/backup/${thetime}_${rom}_${kernel}
EOF

elif [ "$cwm" -ge 3 ]; then
# CWM3+ syntax
cat > $cmdfile<<EOF
ui_print("Tasker Nandroid Backup: ${thetime} ${rom} ${kernel}");
backup_rom("/sdcard/clockworkmod/backup/${thetime}_${rom}_${kernel}");
EOF
fi

reboot recovery
[Nexus One Themes and Apps] jy3ng4:
Hey guys, not sure if this is the right thread to ask this question but I'm trying to create a profile for when my OG Motorola Droid is Car Docked. I simply want the screen to go from the default timeout (1 minute) to always on, and the Car Home app to either not open or close immediately.

The first part (screen timeout) is easy but I'm having trouble with killing the Car Home app. Could someone tell me what actions I need to add to kill the app?

I'm guessing the easiest way would be "Wait 50ms" followed by "Kill app -> Car Home" although there are two "Car Home" apps listed for some reason so I guess I'd do a Kill App for both? Would this work?
[Nexus One Themes and Apps] brandall:
Thank you for my blessings :) this looks good - will test it out later/tomorrow!
[Nexus One Themes and Apps] strictlyrude27:
Here's another idea that I'm playing with!

I wanted to both do a Nandroid AND Titanium backup - so I wouldn't need to perform a full-blown nandroid restore if an app screwed up, or I could restore a previous nandroid and individually restore apps as needed.

Titanium Backup doesn't work with Tasker, but it leaves you with a notification when backups are done. So I set the backup schedule in Titanium Backup that I want (in my case, nightly), then the settings I want for a Nandroid to occur (must be connected to power; must be on my preferred wifi; etc).

The final piece of the puzzle is to use a Notification Event context from Tasker - the owner application is obviously Titanium Backup ; the title should be "Titanium Backup - Batch backup finished." (Add the word "Pro" if necessary.)

Now a TB occurs every night, and Nandroid backups occur after TB backups occur! Nice.
[Nexus One Themes and Apps] ewingr:
Toggle Calendar AutoSync?

I don't know how often or what triggers Calendar synchronization. But my wife's phone is on the small data plan, and for all intents and purposes, doesn't need more. But that requires managing the sync, and of course that isn't WAF.

I have set up a task to toggle settings/autosync on if on WIFI at home. But I see no way to do that for the Calendar. And if I set calendar autosync off, then there isn't even a refresh/resynch button on the initial menu.

Any suggestions?

Also, if any other suggestions for managing the data, will be glad to hear them.
[Nexus One Themes and Apps] strictlyrude27:
if anyone's interested, I wrote a Tasker task/script to automatically download the latest CM7 nightly; backup current ROM; and flash said nightly and GApps package.

see http://xdaforums.com/showthread.php?t=1198065

</pimp> :)
[Nexus One Themes and Apps] goninph:
Hello,

When using another application for managing contacts and Dialer with Gingerbread deletion of the notification of missed calls in the taskbar does not work when clicking on the missed call icon.

Is it possible to correct this problem with Tasker?

Clear the notifications of missed calls (or all notices) when closing the system tray?

Or would you have another solution to fix this problem?

Thank you for your help
[Nexus One Themes and Apps] teh_lorax:
Very slick...
[Nexus One Themes and Apps] nyx528:
Google Reader unread count in Minimalist Text Widget?

Here's my help request from the noob thread.

http://xdaforums.com/showpost.php?p=16483651&postcount=363

Any help would be greatly appreciated! :D
[Nexus One Themes and Apps] crachel:
This is possible, but it's not going to be pretty ;)

I will just outline the process here to maybe help you get started, maybe someone smarter will come in here and give a step-by-step.

First of all, authentication. I believe if you are logged in to your Google Reader account from your browser, Tasker will use these cookies and be able to send GET requests without requiring separate authentication/tokens. You will just have to always make sure you're logged in within your browser

You will then use Tasker to send a HTTP GET request to:

which will return XML to variable %HTTPD

This XML will need to be parsed, you are interested in the following data:

where 24 is my current unread count. use variable split with operator

since this will be unique (the term reading-list always precedes your unread count). somewhere in your new SPLIT variable will be the "24". hopefully Tasker's new Variable manager will help trouble shoot how many splits you need to do and where your target info is.

your only possible hang up here is the authentication step.

sorry I can't be more thorough, but please post your progress and we'll try to help some more..
[Nexus One Themes and Apps] Stevethegreat:
Hi, I'm creating a "dock emulator" for my galaxy S.

I've created a custom dock which takes as an input the charger and the tvout cable and when both are connected it triggers a series of events/tasks which turn the phone into a media center (it gains access to my main media server wirellessly, it auto-overclocks, it enables connection with a bluetooth remote and bluetooth handsfree, and it opens a media center environment which are all output to the tv that it is connected).

Even though I have done all of the above and work perfectly in tasker, I stumble in a seemingly minor point, I don't know/get how I can possibly have the tv-out option be checked automatically as part of the -above- string of events. Here's my post on the noobs' thread: http://xdaforums.com/showpost.php?p=16501647&postcount=364

Thanks for any help.
[Nexus One Themes and Apps] nyx528:
So I made a new task named "GReader Unread" and a Minimalist Text Widget variable named %MNMLU.

First task: HTTP Get

>Server:Port

http://www.google.com/reader/api/0/unread-count?all=true

>done

Second Task: Variable Split

>Name: %HTTPD

>Splitter: reading-list </string> <number name="count">

>Done

When I try to run this task I get the error "Can't Split Unset Variable %HTTPD" :(

I'd like to add at this point that I haven't done anything like this. The gets and sets and splits and stuff is a wee bit beyond me. I'm a quick learner, but I'm gonna need details to get it right the first time.

Thanks!
[Nexus One Themes and Apps] crachel:
Have you logged into Google Reader from your browser?

Your splitter may need to be boiled down to just "reading-list" as sometimes carriage returns, spaces, etc can cause problems

nyx528, I'm interested in this as well and I will have some free time this weekend for this type of thing, so I can give a step-by-step then.
[Nexus One Themes and Apps] nyx528:
I have made sure that I'm logged onto reader on my phone, I was getting errors from there at first, heh.

Fixed that, though.

Next, I'll try to shorten the split and see if that helps. Do I need to figure out which %VAR the number is set to after that right?

::edit::

Shortened the split and I'm still getting the error "Can't split unset variable: %HTTPD".

Seems that the HTTP Get command is not correctly setting the %HTTPD variable :/
[Nexus One Themes and Apps] Stevethegreat:
Can I at least know whether what I'm atempting is possible at all?

I'm trying for 3 days now to make it work (make one setting to be ticked automatically) but to no avail.

Making this work or not would be the deciding factor on whether I'd buy tasker or not (whether this app is for me or not).

So can you tell me whether Tasker has the above capability? Please.
[Nexus One Themes and Apps] monkey21stc:
Can you post your whole set up so I can try to replicate?
[Nexus One Themes and Apps] Stevethegreat:
I would be glad to, but since you're on a Desire S I think it's impossible for you to replicate it. The option I'm trying to turn on (through Tasker) exists only on Galaxy S (and no matter what I try it *never* turns on, unless *I* tick it in particular).

Thanks for your offer to help though. I got to ask though, if you want tasker to turn *your* phone's TV out option (I assume it has one) how would you go about in doing it?
[Nexus One Themes and Apps] monkey21stc:
Well unfortunately, the desire s does not possess a tv out. It does however have the capability to connect wirelessly to a media output (I'm guessing dlna support). Haven't tried it though. Sorry couldn't help much..
[Nexus One Themes and Apps] crachel:
I'm having the same issue. I'm logged in to Reader from my browser, but apparently Tasker doesn't use the built in browser for GET requests:

When I run a task that is JUST

First task: HTTP Get

>Server:Port

http://www.google.com/reader/api/0/u...count?all=true

I get an error:

"received authentication challenge is null"

Now, I'm assuming I'm going to have to do all that authentication token stuff outlined on your API workaround link. Meaning ClientLogin with HTTP POST and extracting tokens.. a lot of trial and error, I'm just not gonna have time for. So, your HTTPD variable isnt being filled because the GET request fails for lack of authentication..
[Nexus One Themes and Apps] Stevethegreat:
Hmm and I guess DLNA works differently than TV-out so it wouldn't be of much help anyhow... Now say that you want to turn on your wi-fi module *without* using Tasker's inbuilt command, would be easy to tell me how you'd go about in doing it? (for example would you create an action intent of your own?)
[Nexus One Themes and Apps] monkey21stc:
Sadly, I'm not very familiar with action intents, under what conditions do you want your wifi module to be turned on? If you do not want to use tasker, you can try llama location profiles to trigger wifi.
[Nexus One Themes and Apps] Stevethegreat:
It was just an example. I do not *actually* want "the wifi to be turned on", I merely wanted to see how would one could go about in doing it by using an "action intent", so that I can replicate his method only changing it a bit for my own purposes...

Thanks for your effort(s) anyhow.

Edit: The role of action intents (I think) is to mess directly with android's classes (programmatically).

My point (what I want to find) is HOW can I find which class controls the tvout in my phone?

I attached my phone's activity logs (when I turned the tvout on), but they were not of much help. And even if I find the class in question how can I tell tasker that I want to use it (to be "switched on"). Sorry that I'm a bit of a noob programmatically but for the veterans in here it should be a piece of cake to tell me how I can find such a class's name and how I can switch it on...
[Nexus One Themes and Apps] nyx528:
See, I haven't had that error. I tried just the HTTP Get and I didn't get any errors, so that part is working just fine for me. For some reason the HTTP Get isn't populating the %HTTPD with it's info. I think maybe there's a step missing?

I haven't the faintest how to proceed :/
[Nexus One Themes and Apps] strictlyrude27:
Someone please correct me if I'm wrong, as I'm just a budding developer for Android; most of my experience as a dev is through Tasker :cool:

Firing an activity like this is only possible if that app set that activity as public, which requires either (a) you have access to the source code that denotes it is a public activity; or (b) the developer has told his users the activity is public (typically by providing an API). Typically only launcher activities (the activity that starts by pushing the icon in your launcher) are public; "activity" in the Android sense corresponds to individual UI screens in the "user interface" sense.

Non-launcher activities are typically only provided if it makes sense for another app to be able to use that activity, e.g., the Barcode Scanner's main activity can be used by other apps to implement barcode scanning without having to write their own barcode scanning code. Making all activities public violates some fundamental concepts of object-oriented programming and makes it easy for malicious apps to do malicious things.

So even if you have the activity in hand, it's a moot point if it wasn't public, and if it was public, there likely would have been a way to have figured this out by now.
[Nexus One Themes and Apps] Stevethegreat:
I do have found out a class named "com.android.setting.system.tv_out" but I cannot turn it on ("state:1"), also there's another named "com.android.settings.TvOutSettings" but it cannot be turned on either.

Lastly I have the module's (tv out's) number, but I don't know what I can do with it.

In general I'm not sure whether samsung would want other apps to mess with her phones' TV-out settings (for some reason). But then again I see no reason why she wouldn't do so. I mean there has to be a way that replicates the actions of tapping on (ticking) the Tv out setting, no?

Thans for the info though...
[Nexus One Themes and Apps] crachel:
Using Secure Settings Tasker plugin [xda thread]

When I'm on a known WiFi, I disable the Pin. When I leave known Wifi, the pin is enabled. So, if I leave my phone somewhere, the security is protecting me. This has one problem though, sometimes in my car, I'll get a message that I need to read (I don't reply while driving), but inputting the Pin several times SUCKS.

So, I've created a very simple "Shake" profile that, when activated disables the Keyguard all together for 5 minutes. That way, I'm driving, input the Pin once, shake the phone and for 5 minutes the pin/keyguard are totally disabled. Simple, but very handy for me!

Profile -> Event -> Sensor -> Shake

One thing too about this task, click the wrench/screw driver icon and under "Collision Handling" change to "Abort Existing Task". There is a trivial "Notification Click" profile (Action #1 above) that once clicked enables the Keyguard again (in case I didn't want to wait the 5 minutes). Problem is, if you click it, then shake again, the task won't register your shakes until the 5 minutes is up. "Abort Existing Task" fixes this.

(I know some of you already know about this plugin but others of you may have not seen it yet.)
[Nexus One Themes and Apps] A$h x:
Okay there two similar tasks I am trying to achieve within takser. I have written the pseduocode but have no idea how to write the task itself.

Task 1 - Switch on GPS & data for various apps

WHILE (appname = GOOGLE MAPS) OR (appname = GPS STATUS) OR (appname = NAVIGATION) is active

DO

If GPS_ON = 1 THEN exit task

ELSE

turn on GPS

ELSE turn off GPS

WHILE (appname = GOOGLE MAPS) OR (appname = GPS STATUS) OR (appname = NAVIGATION) is active

DO

If DATA_NETWORK_ON = 1 THEN exit task

ELSE

turn on packet data

ELSE turn off packet data

I don't know the exact variable names, I know on the SGS2 you can turn off packet data from the power menu. Here is the second task:

Task 2 - Hourly sync data for various apps

IF CURRENT_TIME = x:00 THEN

If DATA_NETWORK_ON = 1 THEN exit task

ELSE

turn on packet data

turn on background data

refresh (appname = GMAIL) AND

refresh (appname = GOOGLE PLUS) AND

refresh (appname = ACCUWEATHER_WIDGET)

WAIT 30 secs

turn off packet data

turn off background data

ELSE exit task

Can someone knock up a profile for these tasks, or at least give me a starting point? Thanks.
[Nexus One Themes and Apps] strictlyrude27:
For your loops, take a look at my Flow Control with Tasker tutorial. That should be a good start..
[Nexus One Themes and Apps] kantjer:
I'm trying your script and have it working by loading into GScript but I can't get to work using Tasker.

What I did is copy the entire script into the execute "Run Command" part of the Secure Settings plugin and give it root access. But when I execute it nothing happens. Can you please give some pointer on how to get this running via Tasker.

Thanks,

Bauke
[Nexus One Themes and Apps] strictlyrude27:
You need to put that script into a file, like /sdcard/nandroid.sh - in Secure Settings plugin, the command should be "bash /sdcard/nandroid.sh", and use root of course. If it reboots to recovery but doesn't do anything, you should make the Secure Settings command be "mount -o rw,remount /system; bash /sdcard/nandroid.sh".
[Nexus One Themes and Apps] kantjer:
Thanks, I tried both commands but in both cases I'm getting a "bash not found" error.
[Nexus One Themes and Apps] waydownsouth:
Not all roms have bash installed... try this:

sh /sdcard/nandroid.sh

HTH :)
[Nexus One Themes and Apps] kantjer:
Unfortunately still no luck, now I'm getting the following output: :confused:

not found
not found
not found
[Nexus One Themes and Apps] waydownsouth:
hmm, ok,

you have created the file on your sdcard with the contents of strictlyrudes script?

which version of cwm do you have? & do you have ROM Manager installed?

if you could try this command from a console & post up all the output.

sh -x /sdcard/nandroid.sh

the -x flag will give us a whole lot more debugging info
[Nexus One Themes and Apps] kantjer:
yes I have created the sh file on the SD card with the exact contents of strictlyrudes script.

I'm using cwr 4.0.1.5 and ROM Manager Premium 4.4.0.5

Log:

not found

not found
settingsfile=/sdcard/clockworkmod/.settings
cmdfile=/cache/recovery/extendedcommand
last_log=/cache/recovery/last_log

not found
date +%F-%I.%M.%S%P
thetime=2011-09-02-09.19.13am
uname -r
kernel=2.6.32.15_r8.3-geb94bc6

not found
sed s/CyanogenMod/CM/
getprop ro.modversion
rom=HyperDroid-GBX-v12

not found

/sdcard/nandroid.sh: 38: Syntax error: "elif" unexpected (expecting "then")

Hope this helps,Thanks again for your support.

Bauke
[Nexus One Themes and Apps] waydownsouth:
The errors aren't really making a whole lot of sense... :(

I'm wondering if you used a windows based text editor to create the file?

The problem lies in how windows & linux treat end of line characters,

Something that is created in windows can cause this sort of error when you try to execute it in a linux/android system...

If this is the case then you should use notepad++ when creating scripts for android... & make sure the appropriate option (unix compatibility) is selected in the preferences.

Alternatively, you could try this command from the famous 'sed one liners' to fix the end of line characters (no guarantees it will work... but, worth a shot :) )

sed -i 's/.$//' /sdcard/nandroid.sh

HTH
[Nexus One Themes and Apps] kantjer:
Thanks that solved it. I thought I saved it in Unix format, but clearly I didn't. I can now make scheduled backups again.

Bauke
[Nexus One Themes and Apps] strictlyrude27:
Note that starting with CWM5+, this script won't work. Turns out Koush added a layer of protection so we can't access recovery via /cache/recovery/extendedcommand - there is some kind of cryptography that is checked when you enter recovery mode like this - all I know is there is a 32-character string that looks like a checksum of some sort in last_log. The .settings file was replaced with a cease-and-desist letter, and there is now a binary .settings2 file.

I tried just firing the action intent, but it checks for an app license and throws an exception if it's not found.

:(
[Nexus One Themes and Apps] waydownsouth:
Yea, noticed that...

Slightly monopolistic move... kinda goes against the whole spirit of setting your phone free... :(

Now that cwm is the de-facto standard in custom recoveries & rommanager is distributed directly with CyanogenMod... it gets force fed to users... this I feel goes against everything Cyanogen stands for...

Instead of locked bootloaders, users get locked recoveries...

Disappointing.
[Nexus One Themes and Apps] SilentSummer:
Is it possible to setup a task that will backup the contents of the sdcard weekly to your PC/Server?
[Nexus One Themes and Apps] waydownsouth:
rsync4android has Tasker/Locale integration which should be able to do this for you...

XDA Thread

Market Link

Homepage
[Nexus One Themes and Apps] crachel:
SilentSummer, I do this as do several other people and it works fantastically. Check out waydownsouth's links and if you need anymore help, let us know.

I setup a RSYNC over LAN and one over WAN.. that way when Tasker sees I connect to my home WiFi, it uses the LAN option so as to not send a NANDROID (or something else large) over to my server via the WWW.. I use the WAN option when taking pictures out and about that I want to quickly backup over to my server.

Edit: his market link is bad, here it is https://market.android.com/details?id=eu.kowalczuk.rsync4android

Edit2: I suggest the rsync4android app because it handles failure better, but here is a post I did not too long ago, that gives more information on doing this via commands as well, http://xdaforums.com/showpost.php?p=8335088&postcount=218
[Nexus One Themes and Apps] SilentSummer:
Looks like all the instructions are for Linux. I'm wanting to install SSH Server on my Windows Home Server as that is where I want the SDCard backed up to.
[Nexus One Themes and Apps] SilentSummer:
Ok so I was able to setup CopSSH on WHS and got it running with my username. Put the key in /home/user/.ssh. I also copied the rsync.exe into the bin folder.

The Rsync app connect with no issues but I get the following:
[Nexus One Themes and Apps] crachel:
That is a successful rsync, however nothing was sent! Could be a lot of things, first guess is your local file or directory needs to be "/sdcard/" is this what you have there within the rsync app?
[Nexus One Themes and Apps] Adolf1994:
Do anybody know about a task what enable the stock music("video") player on X10?

I need this, because my HAWX freeze if I play the intro video with Mediascape or other players :'(

I updated my phone, and Bin4ry told me I should use Tasker

Thanks in advance!