Giter Club home page Giter Club logo

Comments (17)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
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 [email protected] on 6 Jun 2012 at 6:05

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
Great! Thanks!!!

Original comment by [email protected] on 6 Jun 2012 at 2:51

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
The script service keeps on running no matter what I change 
"IS_FOREGROUND_SERVICE" to. Any ideas?

Original comment by [email protected] on 7 Oct 2012 at 5:06

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
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 [email protected] on 7 Oct 2012 at 5:19

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
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 [email protected] on 7 Oct 2012 at 7:40

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
Could you attach a minimal script reproducing the problem ?

Original comment by [email protected] on 8 Oct 2012 at 5:03

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
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 [email protected] on 8 Oct 2012 at 7:15

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
Just the zip is fine.

Original comment by [email protected] on 8 Oct 2012 at 7:21

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
[deleted comment]

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
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 [email protected] on 8 Oct 2012 at 7:00

Attachments:

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
[deleted comment]

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
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 [email protected] on 8 Oct 2012 at 7:15

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
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 [email protected] on 8 Oct 2012 at 7:51

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
Attached my test APK.

Original comment by [email protected] on 8 Oct 2012 at 8:12

Attachments:

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
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 [email protected] on 8 Oct 2012 at 8:39

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
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 [email protected] on 8 Oct 2012 at 8:59

from android-python27.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
Glad that's working now. I would bet for an Eclipse/ADT bug, I hit already so 
much of them.

Original comment by [email protected] on 8 Oct 2012 at 9:01

from android-python27.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.