android-json-rpc time/size problem
<p>I am trying to use <a href="http://code.google.com/p/android-json-rpc/" rel="nofollow">http://code.google.com/p/android-json-rpc/</a> library to upload data from my android phone to webserver. But for a simple and rather small upload size there is error and it takes too long. What could be the problem, anyone willing to help?</p>

<p>Here is the code:</p>

<p>PHP - serverside</p>

<pre><code>    public function acme_func($size) {
    $store = "";

    for($i = 1; $i &lt;= $size; $i++){
        $store = $store . "a";
    }

    return $store;
}
</code></pre>

<p>Java client side:</p>

<pre><code>    public class main {

/**
 * @param args
 */
public static void main(String[] args) {

    JSONRPCClient client = JSONRPCClient.create("http://127.0.0.1/json/includes/test.php");
    client.setConnectionTimeout(90000);
    client.setSoTimeout(90000);
    try 
    {

        System.out.println("Size: " + client.callString("acme_func",""+(400*1024)).length()/1024 + " kB");

    }
    catch (JSONRPCException e)
    {
      e.printStackTrace();
    }
    System.out.println("Running finished!");
}
</code></pre>

<p>}</p>

<p>When I set 400*1024 it breaks:</p>

<blockquote>
  <p>Some Proper Name 1
  org.alexd.jsonrpc.JSONRPCException: Invalid JSON response
      at org.alexd.jsonrpc.JSONRPCHttpClient.doJSONRequest(JSONRPCHttpClient.java:108)
      at org.alexd.jsonrpc.JSONRPCClient.doRequest(JSONRPCClient.java:44)
      at org.alexd.jsonrpc.JSONRPCClient.callString(JSONRPCClient.java:145)
      at main.main(main.java:21)
  Caused by: org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
      at org.json.JSONTokener.syntaxError(JSONTokener.java:423)
      at org.json.JSONObject.(JSONObject.java:183)
      at org.json.JSONObject.(JSONObject.java:310)
      at org.alexd.jsonrpc.JSONRPCHttpClient.doJSONRequest(JSONRPCHttpClient.java:83)
      ... 3 more
  Running finished!</p>
</blockquote>

<p>But lower values like 300*1024 work.</p>

<p>Is JSON smart choice for transfering strings bigger than 400kB at all, what could be the problem?</p>
