damonkohler / sl4a

SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device.
Apache License 2.0
2.44k stars 800 forks source link

Add triggers that work more like cron #253

Open damonkohler opened 9 years ago

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:25

Currently triggers launch a script every n seconds. A behavior more like 
cron where a script can be run repeatedly at certain times would also be 
useful.

Original issue reported on code.google.com by damonkoh...@gmail.com on 27 Mar 2010 at 7:26

Copied from original issue: damonkohler/android-scripting#271

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:25

Why not implement cron directly? I've always thought a phone needs a launch 
scheduler; one tht works exactly like cron. (i.e. you can do something such as 
*/5 * * 7,8 6-7 xxx).

A crond service for Android would be very useful, not just for SL4A, but for 
anything else, provided you could call any application or perform activities 
with some sort of activity chooser.

Original comment by mprz1024@gmail.com on 8 Jul 2011 at 11:53

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:25

2nd

Original comment by mplscor...@gmail.com on 8 Jul 2011 at 8:31

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:25

check out TaskBomb on the android markey, it does what you're asking for
https://market.android.com/details?id=org.androidideas.taskbomb&feature=search_r
esult

Original comment by Paul.A.D...@gmail.com on 28 Sep 2011 at 4:04

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:25

Just curious why can't you just use the time module in python inside of a while 
loop and either 
a) time.sleep(x) for the time you want or
b) inside of the loop check the current time and compare against your static 
time.  

After the task has ran you can of course reset the variable for (in this case 
x, time.sleep(x)) or increment the next day for your script to run?  

If its possible to do this, it wouldn't be hard to just write your own cron.py 
lib and import to the scripts you need to run at a certain time etc.

Original comment by Jamaal.Speights@gmail.com on 7 Jan 2012 at 4:20