Tasker and Csipsimple

jerrywaggoner

New Member
Joined
Dec 20, 2010
Messages
13
Reaction score
0
Has anyone been able to get these two to play nicely together? I'll admit I'm still a Droid/Tasker noob, but what I'm trying to do shouldn't be this hard. I simply want to enable Csipsimple at 8:30am and disable it at 5:00pm M-F. Using Tasker to kill the app doesn't work. Trying to use the action intent 'com.csipsimple.service.ACCOUNT_ACTIVE_CHANGED' doesn't work (Issue 267 - csipsimple - Action intent to activate/de-activate an account? - Project Hosting on Google Code).

Csipsimple comes with a handy widget for enabling/disabling accounts, which does exactly what I need, so if I could just toggle that widget on the above schedule I would be set. I peeked at the Csip database and the widget only seems to be toggling the Active field from 1 to 0. Can I get Tasker to run some kind of SQL script to update that field? Is there a way to see what that widget is actually doing with ADB? What are my debugging options?

For all the amazing things Tasker appears to be capable of, simply turning an app on and off shouldn't be this difficult. Any and all help would be appreciated. Thanks.
 

NebulaOcton

Member
Joined
Jun 24, 2010
Messages
328
Reaction score
0
Has anyone been able to get these two to play nicely together? I'll admit I'm still a Droid/Tasker noob, but what I'm trying to do shouldn't be this hard. I simply want to enable Csipsimple at 8:30am and disable it at 5:00pm M-F. Using Tasker to kill the app doesn't work. Trying to use the action intent 'com.csipsimple.service.ACCOUNT_ACTIVE_CHANGED' doesn't work (Issue 267 - csipsimple - Action intent to activate/de-activate an account? - Project Hosting on Google Code).

Csipsimple comes with a handy widget for enabling/disabling accounts, which does exactly what I need, so if I could just toggle that widget on the above schedule I would be set. I peeked at the Csip database and the widget only seems to be toggling the Active field from 1 to 0. Can I get Tasker to run some kind of SQL script to update that field? Is there a way to see what that widget is actually doing with ADB? What are my debugging options?

For all the amazing things Tasker appears to be capable of, simply turning an app on and off shouldn't be this difficult. Any and all help would be appreciated. Thanks.

Tasker can run scripts. If you can write it in Python to do what you want then I can set up tasker to run it for you.
 
OP
J

jerrywaggoner

New Member
Joined
Dec 20, 2010
Messages
13
Reaction score
0
Thanks for the response. I don't know the first thing about Python, but I am familiar enough with scripting, Linux and SQL. Based on some quick research, I imagine the Python script would look something like this:

import sqlite3

con = sqlite3.connect("/data/data/com.csipsimple/databases/com.csipsimple.db")

cur = con.cursor()

sql = "UPDATE accounts SET active = 0 WHERE id = 1"

try:
cur.execute(sql)
con.commit()
except:
con.rollback()

con.close()



BTW, my phone IS rooted, in case that is a requirement or makes things any easier. Thanks.
 

NebulaOcton

Member
Joined
Jun 24, 2010
Messages
328
Reaction score
0
Thanks for the response. I don't know the first thing about Python, but I am familiar enough with scripting, Linux and SQL. Based on some quick research, I imagine the Python script would look something like this:

import sqlite3

con = sqlite3.connect("/data/data/com.csipsimple/databases/com.csipsimple.db")

cur = con.cursor()

sql = "UPDATE accounts SET active = 0 WHERE id = 1"

try:
cur.execute(sql)
con.commit()
except:
con.rollback()

con.close()



BTW, my phone IS rooted, in case that is a requirement or makes things any easier. Thanks.

I really don't know anything about Python or how to script myself. I just know how to get Tasker to recognize and run them. Rooting shouldn't be required either I don't think.
 
OP
J

jerrywaggoner

New Member
Joined
Dec 20, 2010
Messages
13
Reaction score
0
OK, then. Let's just see what happens. What's the worst that could happen? :)
 

NebulaOcton

Member
Joined
Jun 24, 2010
Messages
328
Reaction score
0
Install this http://android-scripting.googlecode.com/files/sl4a_r3.apk
Then follow the instructions here InstallingInterpreters - android-scripting - A howto for installing additional interpreters. - Project Hosting on Google Codeto install python. Both are going to be needed for this profile.

You are also going to need your script saved to your /sdcard/sl4a/scripts/ directory on your phone. You can write it with the software you just installed.

Then you can setup a profile that used the SL4A plugin that tasker will have available to run your script when you want to.

I would make two scripts one to turn it on and one to turn it off and then two profiles one at the time you want it on to run the on script and one at the time you want it off to run the off script. The profiles should be pretty easy.
 
OP
J

jerrywaggoner

New Member
Joined
Dec 20, 2010
Messages
13
Reaction score
0
Trouble in paradise... I can install SL4A, I followed that link's instructions to add an interpreter, I chose Python 2.6.2 which downloads python_for_android_r1-6.apk, installed it, ran it, and now I'm faced with an 'Install' button. Every time I press it, the screen flashes 'Downloading python_r7.zip, 0% 0/100' then instantly shows 'Installation failed'. I've tried re-installing both SL4A and Python, same result. Any ideas?
 

NebulaOcton

Member
Joined
Jun 24, 2010
Messages
328
Reaction score
0
I just uninstalled Python and am reinstalling it, but I had no issues. I would try uninstalling, reboot and install again. Short of that you will have to ask the guy who wrote it.
 
OP
J

jerrywaggoner

New Member
Joined
Dec 20, 2010
Messages
13
Reaction score
0
Can you confirm you have a /data/data/com.google.ase folder? I am trying to follow some manual installation instructions, but I don't seem to have this folder, which puts the kibosh on the whole thing.
 
OP
J

jerrywaggoner

New Member
Joined
Dec 20, 2010
Messages
13
Reaction score
0
Well I got python installed but the fix is a little embarrassing. I'll post it anyway in case it helps others. Droidwall, an android firewall, was installed and enabled, which was blocking the python downloads. Once I disabled droidwall the install went fine. Test scripts are working, I will tinker with custom scripts tomorrow
 
Top