Hi and thanks for any help:
I want to port the java system to Android, and I want to make it available for third-party applications through a transparent standalone service so that it looks like a system library. This system is a VoiceXML interpreter that will interpret documents processed by a third-party application and send the results back to it. The interpretation of these documents can take an arbitrary amount of time, even a very long time.
Now I have a service that creates an interpreter that does all the work. I do this in the startJVoiceXML () method.
The problem is that my service was killed by Android with ANR about 20-30 seconds after creating the service. But if I do not do the hard work (only the code until this time), this service remains on, and it will not be killed for a much longer time.
Do I need to create a thread to do what I need? I will add some comments to the code for further explanation.
thank!
public synchronized void startJVoiceXML(final URI uri) throws JVoiceXMLEvent, InterruptedException
{
AndroidConfiguration config = new AndroidConfiguration();
jvxml = new JVoiceXmlMain(config);
jvxml.addListener(this);
jvxml.start();
int a=0;
this.wait();
while(a<1000)
{
Thread.sleep(500);
Log.e("JVoiceXML","esto en el while");
a=a+1;
}
}
public synchronized void jvxmlStarted() {
this.notifyAll();
}
source
share