1. You want that $100.00 in your pocket or an Amazon Fire TV don't you? Well here's the deal. With our new updated look we are in desperate need of an updated logo. The 'old' one has certainly served us well, but it's time. Find all the details here: bit.ly/1q0k6Wa
  2. DroidForums.net is currently undergoing a major software upgrade. If you are experiencing any problems logging in please: Contact Us

Tasker and Csipsimple

Discussion in 'Android Applications' started by jerrywaggoner, Dec 27, 2010.

  1. jerrywaggoner
    Offline

    jerrywaggoner New Member

    Joined:
    Dec 20, 2010
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    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.
  2. NebulaOcton
    Offline

    NebulaOcton New Member

    Joined:
    Jun 24, 2010
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    0
    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.
  3. jerrywaggoner
    Offline

    jerrywaggoner New Member

    Joined:
    Dec 20, 2010
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    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.
  4. NebulaOcton
    Offline

    NebulaOcton New Member

    Joined:
    Jun 24, 2010
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    0
    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.
  5. jerrywaggoner
    Offline

    jerrywaggoner New Member

    Joined:
    Dec 20, 2010
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    OK, then. Let's just see what happens. What's the worst that could happen? :)
  6. NebulaOcton
    Offline

    NebulaOcton New Member

    Joined:
    Jun 24, 2010
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    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.
  7. jerrywaggoner
    Offline

    jerrywaggoner New Member

    Joined:
    Dec 20, 2010
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    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?
  8. NebulaOcton
    Offline

    NebulaOcton New Member

    Joined:
    Jun 24, 2010
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    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.
  9. jerrywaggoner
    Offline

    jerrywaggoner New Member

    Joined:
    Dec 20, 2010
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    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.
  10. NebulaOcton
    Offline

    NebulaOcton New Member

    Joined:
    Jun 24, 2010
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    0
    I do not.

    Try this, its where I learned to install sl4a and python
    Using SL4A with Tasker - Tasker Wiki
  11. jerrywaggoner
    Offline

    jerrywaggoner New Member

    Joined:
    Dec 20, 2010
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    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
Search tags for this page
csip tasker
,
csipsimple database
,
csipsimple how to use in android with intent
,
csipsimple script
,

csipsimple tasker

,
csipsimple tasker kill
,
csipsimple tasker plugin
,
csipsimple widget
,
python for android r1 apk
,
pythonforandroid-r7.apk
,
sl4a apk
,
sqlite3 android calendar tasker
,

tasker csipsimple

,
tasker kill app instructions
,
tasker sqlite