Scheduled Scripting App - Scheduled Reboots, etc... Phone Prioritizer App

Search This thread

jinx10000

Senior Member
May 2, 2009
336
21
This is the phone prioritizer app for the people that are looking for it.

As title states this allows you to schedule scripts to run at specific times and time intervals.

Place scripts you want to run into the following files in the folder /sdcard/phonePrioritizer:
reboot.txt - Runs one time nightly at scheduled time (placing reboot in this file will reboot your phone on cupcake but not on hero)
script.txt - Runs at scheduled intervals (5 minutes to 24 hours)
afterboot.txt - Runs one time after each reboot

Open the phonePrioritizer app and set options by pressing menu. (Buttons on main page of app only control the script.txt script, rest of the scripts are controlled in preferences.)

!Don't put the word reboot into script.txt or afterboot.txt for obvious reasons!
 

Attachments

  • ScriptScheduler2r2.zip
    14.3 KB · Views: 3,156
Last edited:

jinx10000

Senior Member
May 2, 2009
336
21
Mike, Thanks for the script.

Hope I didn't spoil your surprise on your awesome script. I figured I would still release this in case someone has a need for it.

It is working well for me so far.
 

miketaylor00

Senior Member
Jul 17, 2009
1,404
0
Mike, Thanks for the script.

Hope I didn't spoil your surprise on your awesome script. I figured I would still release this in case someone has a need for it.

It is working well for me so far.

I think we both got spoiled by that damn BFS working. It makes my stuff useless if the ROM has it. There are a few ROMs that don't have it yet so it has a little life left in it.
 

jinx10000

Senior Member
May 2, 2009
336
21
LOL. I hadn't heard that. That is too bad.

I had heard that your scripts were working great in xrom and Jacxheroski 1.8. I thought both of those had your script and bfs in them. Of course I haven't looked much today since I have been working on this program.

I guess people can still use my program that want an automated reboot.
 

cx92001

Senior Member
Aug 14, 2009
80
0
Before, it would take at least 3 rings on the caller before I see a notification and my phone rings. When i installed this, my screen showed an incoming call on the first ring on the caller. My phone started ringing on the second ring on the caller though. I'm wondering what adjustment I should make to make my phone ring as soon as I see a notification? I used the default script.txt. thanks
 

miketaylor00

Senior Member
Jul 17, 2009
1,404
0
Before, it would take at least 3 rings on the caller before I see a notification and my phone rings. When i installed this, my screen showed an incoming call on the first ring on the caller. My phone started ringing on the second ring on the caller though. I'm wondering what adjustment I should make to make my phone ring as soon as I see a notification? I used the default script.txt. thanks

Turn off your vibrate on ring. That delays the ringtone. Also the second call usually comes in faster.
 

jinx10000

Senior Member
May 2, 2009
336
21
Updated.

1.7 had a problem where unchecking the Enable Scheduled Reboot would disable the wrong script.

Sorry for those that downloaded it. It is fixed in the newest version.
 
Last edited:

jinx10000

Senior Member
May 2, 2009
336
21
I believe this is the final update. Got it the way I like it.

Cleaned up the code a little.
Now runs completely in the background. No toast when script runs.
 

jinx10000

Senior Member
May 2, 2009
336
21
I really think this is the final version. lol

I had left some unnecessary timers in 2.0. --- Run script wait a few seconds then kill service. Was not sure if this was necessary when I first started making this program. I doubt for those with earlier versions that it will make any difference. --- Doesn't seem necessary so removed. I thought I had removed them in 2.0.

I have a question for Java/android programmers. The code that I found to call the services is :

mAlarmSender = PendingIntent.getService(AlarmService.this, 1394, new Intent(AlarmService.this, AlarmService_Service.class), 0);

timeSet = calendar.getTimeInMillis();

AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);

am.setRepeating(AlarmManager.RTC_WAKEUP, timeSet, whateverTime, mAlarmSender);

In order to setup multiple schedules I have created multiple services and called them in mAlarmSender variable. For ex, AlarmService_Service, AlarmReboot_Service, etc... However, these do almost the same thing. How can I combine them into the same service and distinguish the exact purpose for which it is being called?
 

jinx10000

Senior Member
May 2, 2009
336
21
all scripts run as su.

Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
...
os.writeBytes("exit\n");
os.flush();
 
Last edited:

jinx10000

Senior Member
May 2, 2009
336
21
Uploaded source if anyone is interested.

The program appears to be fully functional.
 
Last edited:

innerspace

Senior Member
Jun 23, 2009
392
7
Thanks so much for this.

afterboot.txt is exactly what I was looking for a few days back. Now I can finally have an IM app launch at boot, might actually use the thing now lol.

Nice work, appreciate the app.
 

Proxin

Senior Member
Feb 6, 2009
468
14
Pallet Town
Great job with the app :)
If anyone needs a command to kill a certain task on startup (AK Notepad was starting up for me all the time), do the following:
Type in Terminal
Code:
ps

This will display all of the processes that are currently running.
Find out the PID of your process you want to kill; mine was 491.
Plug it in to where x is:
Code:
kill -9 x

So in my case, I typed:
Code:
kill -9 491

And it killed AK Notepad from processes. So if you want to auto-kill a process, that's what you could do - put kill -9 [your PID here] into the autostart script after every reboot.
Hope this helps.
 

BrooklynAvi

Retired Recognized Developer
Nov 5, 2008
498
74
Brooklyn
www.mibapps.com
Great job with the app :)
If anyone needs a command to kill a certain task on startup (AK Notepad was starting up for me all the time), do the following:
Type in Terminal
Code:
ps

This will display all of the processes that are currently running.
Find out the PID of your process you want to kill; mine was 491.
Plug it in to where x is:
Code:
kill -9 x

So in my case, I typed:
Code:
kill -9 491

And it killed AK Notepad from processes. So if you want to auto-kill a process, that's what you could do - put kill -9 [your PID here] into the autostart script after every reboot.
Hope this helps.

Correct me if I'm wrong but I don't believe the PID is a constant, i.e. it changes.
 

BrooklynAvi

Retired Recognized Developer
Nov 5, 2008
498
74
Brooklyn
www.mibapps.com
Yes, just realized that too :eek:
Haha oh well. Maybe someone someday will find use in this instead of buying/downloading a task manager app :D

I use GScript for a lot of various scripts that are apps. For example, instead of Clear Me for $1 (which I already bought) I just use GScript to clear my necessary caches. But I found that for task managing purposes I used Advanced Task Manager which pretty much allows you to do just about anything. Sometimes you just need to bite the bullet and pay for an app. :) I'd love to see this thread become huge because I LOVE GScript.
 
Last edited:

ZeroGDarius

Member
Jun 28, 2009
18
0
Ottawa
Great job with the app :)
If anyone needs a command to kill a certain task on startup (AK Notepad was starting up for me all the time), do the following:
Type in Terminal
Code:
ps

This will display all of the processes that are currently running.
Find out the PID of your process you want to kill; mine was 491.
Plug it in to where x is:
Code:
kill -9 x

So in my case, I typed:
Code:
kill -9 491

And it killed AK Notepad from processes. So if you want to auto-kill a process, that's what you could do - put kill -9 [your PID here] into the autostart script after every reboot.
Hope this helps.

if you need a dynamic PID try the below:

Code:
pidof com.akproduction.notepad

so you could create a small script

to store it then run the kill on the variable as i cant seem to get the kill to run it in single quote i get a bad pid message
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    This is the phone prioritizer app for the people that are looking for it.

    As title states this allows you to schedule scripts to run at specific times and time intervals.

    Place scripts you want to run into the following files in the folder /sdcard/phonePrioritizer:
    reboot.txt - Runs one time nightly at scheduled time (placing reboot in this file will reboot your phone on cupcake but not on hero)
    script.txt - Runs at scheduled intervals (5 minutes to 24 hours)
    afterboot.txt - Runs one time after each reboot

    Open the phonePrioritizer app and set options by pressing menu. (Buttons on main page of app only control the script.txt script, rest of the scripts are controlled in preferences.)

    !Don't put the word reboot into script.txt or afterboot.txt for obvious reasons!