sl4a

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:

  1. Create a new task
  2. Make sure the action type is VIEW
  3. Go to select the data, choose “Select script”
  4. Pick the script you want
  5. 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:

  1. Create a new schedule
  2. Go to schedule items
  3. Add a new item
  4. Select the script task as the item’s action
  5. 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:

  1. Go to Quick Run
  2. Select the schedule as the action
  3. Change the duration to 02:00:00
  4. 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/

原文地址:https://www.cnblogs.com/jvava/p/4281803.html