title: Android hashmap converting to JSON in the wrong format
body: <p>I've got a random issue that I cannot seem to work out. Given the following code:</p>
  
  <pre><code>HashMap&lt;String, Object&gt; params = new HashMap&lt;String, Object&gt;();
  params.put("method","getProducts");
  
  HashMap&lt;String, String&gt; methodParams = new HashMap&lt;String, String&gt;();
  methodParams.put("currency", currency);
  
  params.put("params", methodParams);
  restClient.setBodyValueForKey("json", new JSONObject(params).toString());
  </code></pre>
  
  <p>The following hashmaps are converted to JSON and sent to a PHP server.</p>
  
  <p>The server should receive the data in the following format via POST</p>
  
  <pre><code>Array
  (
     [json] =&gt; {"method":"getProducts","params":{"currency":"GBP"}}
  )
  </code></pre>
  
  <p>On some android devices (not sure what the determining factor is) this is correct but on others it is being sent as</p>
  
  <pre><code>Array
  (
     [json] =&gt; {"method":"getProducts","params":"{currency=GBP}"}
  )
  </code></pre>
  
  <p>As you can see the second hash map is being converted into a string and not being added as a HashMap</p>
  
  <p>Does anyone know what could be causing the inconsistency in parsing the HashMaps?</p>
  
  <p>Thanks</p>