First of all thank you very much for this great RAD.
Im wondering how to manage the send/recieve string with XMLRPC lib.. i was using AsyncTask but i saw a post of Erel that said he didnt recommend to use AsyncTask and its better to use BA.submitRunnable... well im trying to do that.. this is my code (java):
b4a call code:
The big problem of this is that the Main UI Thread stucks (waiting for the response -> stringCall() ) It stuck for about 4 seconds.. depending on the sIn size.
So my question is... what is wrong with my code? must i use "RaiseEventFromDifferentThread" ? how can i implement BA.submitRunnable on my stringCall() method...
Hope someone can help me. Thank you very much.
PD. my english sucks i know.. :sign0013:
Im wondering how to manage the send/recieve string with XMLRPC lib.. i was using AsyncTask but i saw a post of Erel that said he didnt recommend to use AsyncTask and its better to use BA.submitRunnable... well im trying to do that.. this is my code (java):
B4X:
public String stringCall(final String Method, final Object p0, final int TaskId)
{
String stringx;
stringx = "";
if (BA.isTaskRunning(this, TaskId))
return stringx;
Runnable runnable = new Runnable()
{
public void run() {
try {
asd = (String)XMLRPC.this.client.call(Method,p0);
}catch (XMLRPCException e) {
// TODO Auto-generated catch block
e.printStackTrace();
asd = "";
}
}
};
BA.submitRunnable(runnable, this, TaskId);
return asd;
}
b4a call code:
B4X:
XMLRPC1.initXMLRPCClient(sUrl)
sOut= XMLRPC1.stringCall(sService, sIn, 0)
The big problem of this is that the Main UI Thread stucks (waiting for the response -> stringCall() ) It stuck for about 4 seconds.. depending on the sIn size.
So my question is... what is wrong with my code? must i use "RaiseEventFromDifferentThread" ? how can i implement BA.submitRunnable on my stringCall() method...
Hope someone can help me. Thank you very much.
PD. my english sucks i know.. :sign0013: