title: Convert a JSON string to a Java/Python (Jython) object?
body: <p>So I understand that you can convert JSON strings to strings and handle JSON objects in general through the org.json bundle in Android, but here's my current situation:</p>
  <p>I need to take a JSON string from a certain URL (I'm already able to successfully do this) and make it into an array. Well actually two arrays. The framework I'm using runs on Python and returns a dict that contains lists (arrays in Python). However, it is displayed as a JSON object. Here's an example of what I would be getting from the URL to my Java code:</p>
  <pre><code>{&quot;keywords&quot;: [&quot;middle east&quot;, &quot;syria&quot;], &quot;link&quot;: [[&quot;middle east&quot;, &quot;http://www.google.com/#q=middle east&quot;], [&quot;syria&quot;, &quot;http://www.google.com/#q=syria&quot;]]}
  </code></pre>
  <p>As you can see, it's a dict of two indices. The first one is &quot;keywords&quot; that has a list and the second one is &quot;link&quot; that contains a list of lists. The two lists (the first one and the second multidimensional one) are what I want to be able to manipulate in Java. I'm aware that you can use JSONArray, but the problem is that the arrays are stored in a Python dict, and my Android application does not properly make a JSONArray. Do you guys have any ideas of how I can handle this? I'm pretty lost. Here is my code for getting the actual JSON string (the URL in the code is not accessible to everyone, it's being served by paste on my machine):</p>
  <pre><code>static public void refreshFeed(){
      try{
          String url = &quot;http://192.17.178.116:8080/getkw?nextline=&quot;+line;
          line++;
          HttpClient httpclient = new DefaultHttpClient();
          HttpGet httpget = new HttpGet(url);
          HttpResponse response;
          response = httpclient.execute(httpget);
          HttpEntity entity = response.getEntity();
          InputStream in = entity.getContent();
  
          BufferedReader reader = new BufferedReader(new InputStreamReader(in));
          StringBuilder sb = new StringBuilder();
              
          String input = null;
          try {
              while ((input = reader.readLine()) != null) {
              sb.append(input + &quot;\n&quot;);
              }
          } catch (IOException e) {
                  e.printStackTrace();
          } finally {
              try {
                  in.close();
              } catch (IOException e) {
                  e.printStackTrace();
              }
           }
          String enter = sb.toString();
          feedEntry add = new feedEntry(enter);
          addNewEntry(add);
          in.close();
          
      } catch(MalformedURLException e){
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
  </code></pre>
  <p>Please also note that this is <em>without</em> the JSONString being made into a JSONArray. It simply translates the JSON object into a regular String that is added to a &quot;feedEntry&quot; object.</p>