Open GoogleCodeExporter opened 8 years ago
Try the new option IS_FOREGROUND_SERVICE set to false in GlobalConstants.java:
see https://code.google.com/p/android-python27/source/detail?r=d88a6707f13d
Original comment by anthony....@gmail.com
on 6 Jun 2012 at 6:05
Great! Thanks!!!
Original comment by mike...@gmail.com
on 6 Jun 2012 at 2:51
The script service keeps on running no matter what I change
"IS_FOREGROUND_SERVICE" to. Any ideas?
Original comment by andy.e.r...@gmail.com
on 7 Oct 2012 at 5:06
This should be fixed see:
http://code.google.com/p/android-python27/issues/detail?id=7
I check with ps that the process died when the script ends.
Original comment by anthony....@gmail.com
on 7 Oct 2012 at 5:19
When I run your test script with "IS_FOREGROUND_SERVICE" set to false,
everything is fine. However when I run my script then the service keeps on
running after my script exits. My script does start some sub-processes, a
bottle server to be precise, but all of these are terminated before my script
exits. My script also works when packaged with the script-for-andriod-template
taken from sl4a.
I intend to do some more experimentation to see if there is something wrong
with my app. Maybe I'm not managing my sub-processes correctly or something.
One last thing, I'd like to take the opportunity to thank you for your hard
work.
Original comment by andy.e.r...@gmail.com
on 7 Oct 2012 at 7:40
Could you attach a minimal script reproducing the problem ?
Original comment by anthony....@gmail.com
on 8 Oct 2012 at 5:03
Yes I can because I just managed to recreate the problem with a simple example.
I can attach the "my_python_project.zip" file or the entire eclipse project I
use for testing. Which do you prefer?
Original comment by andy.e.r...@gmail.com
on 8 Oct 2012 at 7:15
Just the zip is fine.
Original comment by anthony....@gmail.com
on 8 Oct 2012 at 7:21
[deleted comment]
Here is the zip file as requested. The script does the following things:
1) creates a bottle server running in the background
2) starts a browser to read the start page
3) when you close the browser, renders a button so you can stop the bottle server
4) exits
The python process exits but "com.android.python27" does not. If I don't kill
the process my script is started at regular intervals.
Original comment by andy.e.r...@gmail.com
on 8 Oct 2012 at 7:00
Attachments:
[deleted comment]
When I click the button to stop the bottle server both com.android.python27 and
python process exit properly on my device, FWIW I'm using 4.0.4, which android
version are you using ?
You are using IS_FOREGROUND_SERVICE = false, is that correct ?
So BackgroundScriptService class should be used, you can add some Log in
@Override
public void run() {
mProxy.shutdown();
stopSelf(startId);
killProcess();
android.os.Process.killProcess(android.os.Process.myPid());
To see in the Logcat if this is called.
Original comment by anthony....@gmail.com
on 8 Oct 2012 at 7:15
Yes, I'm using IS_FOREGROUND_SERVICE = false and I'm also using android 4.0.4.
Its getting late here in Poland so I'll check the logs tomorrow. Is it possible
that there is something wrong with the way I'm building my applications?
Original comment by andy.e.r...@gmail.com
on 8 Oct 2012 at 7:51
Attached my test APK.
Original comment by anthony....@gmail.com
on 8 Oct 2012 at 8:12
Attachments:
Your app works fine for me too. All processes exited normally. Any chance you
could send me your eclipse project so that I can compare it with mine and also
see what happens when I build an apk with it.
The problem is obviously at my end. I downloaded the repository just a few days
ago and I'm sure the project I'm using is based on that download. I'll redo
everything from scratch and see what happens.
Thanks a lot for your help because I now know where the problem lies.
Original comment by andy.e.r...@gmail.com
on 8 Oct 2012 at 8:39
I just cleaned out all my python projects and downloaded the repository again.
Now everything works fine for me too. Sorry about that, I must have mixed up my
projects somehow. I guess I owe you a beer!
Original comment by andy.e.r...@gmail.com
on 8 Oct 2012 at 8:59
Glad that's working now. I would bet for an Eclipse/ADT bug, I hit already so
much of them.
Original comment by anthony....@gmail.com
on 8 Oct 2012 at 9:01
Original issue reported on code.google.com by
mike...@gmail.com
on 5 Jun 2012 at 12:17