Friday, May 16, 2014

[android-developers] Android native process pauses after 10 to 15 seconds

[I'm not sure if I have to ask this question in the NDK forum]

I have an Android Java app, and also a native app. The native app is launched from the Java app, like this:

mProcess = Runtime.getRuntime().exec(cmdLaunch, null, new File(files_dir));

The native process actually runs in a loop, and sleeps once in a while to yield.

Here's what is happening. After the native process is launched, it runs for about 10 to 15 seconds. After that it just pauses. The Java app is still in the foreground. I know this from the logcat logs. There is nothing that'll make it resume.

Because I'm developing it, I start a new debugging session. This kills the previous Java app, and starts a new one.

Now the native process, which was paused, resumes and continues running as expected. Now this runs indefinitely without pausing.

What is happening here?

When the parent process (Java app) was killed, should the child process (native app) also have been killed? And how come as soon as the parent process was killed, the native process started to run without any issues.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment