Just wanted to get some feedback for a task killer I wrote for android in Python. I used the SL4A .apk which you can get from here:
android-scripting - Project Hosting on Google Code
Then I installed the Python module which that page will also help you out with.
If you give it a try let me know if it worked and what you think of it. I'm also interested if anyone has any suggestions to make it better script wise or just in general. To use this script create a new Python script and paste this script into the coding area. On to the code:
Basically the script gathers all of the currently running processes and creates an alert dialogue. In the dialogue you can select all of the processes that you want to close and the script kills them. Its very simplistic but I like it. To be completely honest I have no coding experience and I pretty much wrote this with trial and error and a lot of reading about Android and Python. Learned a lot in the process though. I'm thinking my next script will be an .apk uninstaller and re-installer. Anyways enjoy.Code:import android droid = android.Android() a = droid.getRunningPackages() proclist = a[1] def taskkiller(proclist): title = 'Running Processes' droid.dialogCreateAlert(title) droid.dialogSetNeutralButtonText('Kill Process') droid.dialogSetMultiChoiceItems(proclist, None) droid.dialogShow() droid.dialogGetResponse() choice = droid.dialogGetSelectedItems().result return choice x = taskkiller(proclist) for y in x: droid.forceStopPackage(proclist[y]) print '%s was closed' % proclist[y]


LinkBack URL
About LinkBacks
Reply With Quote


(my phone) +
(
