How to work with JSON
<p>Okay I'm really sorry if this question has been asked, but I can't seem to find any good help on this. </p>

<p>I coded myself a little API for my android app using PHP and Codeigniter. It works through GET requests, so I'll send it some info and it'll return something. When I send it a login request, I want it to validate the user data, and if correct return the user's credentials (uid, email, etc). All of this information can either be returned as formatted XML or a JSON array. My question is which would be easier to work with in Java, and can you help me with a quick example?</p>

<p>Any help is much appreciated.</p>

<p>EDIT:</p>

<p>Requested Code</p>

<pre><code>                // Parse JSON array
                JSONObject obj = (JSONObject) JSONValue.parse(response);
                String uid = (String) obj.get("uid");
                String email = (String) obj.get("email");
</code></pre>
