title: Convert Twitter4j Status to JSON Object
body: <p>Android 2.3.3</p>
  
  <p>I am integrating Twitter API into my android application. I am using Twitter4j.</p>
  
  <p>I could get the tweets for a particular user, using the below code.</p>
  
  <pre><code>Paging paging = new Paging(1, 40);
  List&lt;twitter4j.Status&gt; statuses = twitter.getUserTimeline("xxx", paging);
  
  Log.d(Const.TAG,"Showing Timeline.");
  for (twitter4j.Status status : statuses) {
      String rawJSON = DataObjectFactory.getRawJSON(status);
  }
  </code></pre>
  
  <p>My requirement is that I need to parse the JSON String (rawJSON), to get some other values like, published date and so on.</p>
  
  <p>I am pretty new to JSON parsing esp., with converting things to JSON. All i know in the above code is that, <code>String rawJSON = DataObjectFactory.getRawJSON(status);</code> converts the <code>Status Object</code> to a <code>String</code> and I can view it by logging it.   </p>
  
  <p>How do I convert this <code>String</code> to a <code>JSONObject</code> or a <code>JSONArray</code>? Can someone provide me with a sample code?</p>
  
  <p>I tried the below code, but it gives an exception</p>
  
  <pre><code>try {
      JSONObject tweet = new JSONObject(rawJSON);
      JSONArray textArray = tweet.getJSONArray("text");
      String text = textArray.getString(0);
  
      Log.d(Const.TAG, "Text = "+text);
  
  } catch (JSONException e) {
      // TODO Auto-generated catch block
      Log.d(Const.TAG, "Error while converting string to json");
      e.printStackTrace();
  }
  </code></pre>