Tutorial: Running a script every 5 minutes
First make sure you have the script launcher add-on, and of course SL4A itself. You’ll probably also want an interpreter (Python, Ruby, etc.) for SL4A installed.
The steps for creating a script task are:
- Create a new task
- Make sure the action type is VIEW
- Go to select the data, choose “Select script”
- Pick the script you want
- Go to select the activity, choose background or foreground (you probably want background)
Now you can run it using Quick Run, an alarm, etc.
To run it every 5 minutes you have to create a schedule:
- Create a new schedule
- Go to schedule items
- Add a new item
- Select the script task as the item’s action
- Change the repeat interval to 00:05:00
Now you have a schedule that runs a script every 5 minutes from START to STOP (the time you start the schedule to the time you stop the schedule). For example to run it every 5 minutes between now and 2 hours from now:
- Go to Quick Run
- Select the schedule as the action
- Change the duration to 02:00:00
- Press Run
Along the way you can try different scenarios without having to actually run them by using the “Calculate” function.
http://androidideas.org/taskbomb/tutorials/running-a-script-every-5-minutes/