title: JSONObject return type
body: <p>The following android application code in Java outputs to: </p>
  
  <pre><code>[{"handle":"DmitriyH","firstName":"Dmitriy","lastName":"Khodyrev","country":"Russia","city":"Moscow","organization":"KL","contribution":122,"rank":"master","rating":2040,"maxRank":"international master","maxRating":2072,"lastOnlineTimeSeconds":1432130513,"registrationTimeSeconds":1268570311}]}
  </code></pre>
  
  <p>when extracting data from codeforces api-  <a href="http://codeforces.com/api/user.info?handles=DmitriyH" rel="nofollow">http://codeforces.com/api/user.info?handles=DmitriyH</a>;</p>
  
  <p>but I only want "firstName" of the user.
  Can anyone recommend changes to my code??</p>
  
  <pre><code>public class Http extends Activity {
     TextView httpStuff;
     HttpClient client;
     JSONObject json;
     final static String URL = http://codeforces.com/api/user.info?handles=;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.httpex);
  
      httpStuff = (TextView)findViewById(R.id.tvHttp);
      client = new DefaultHttpClient();
      new Read().execute("result");
  }
  
  public JSONObject lastSub(String username) throws ClientProtocolException, IOException, JSONException {
      StringBuilder url = new StringBuilder(URL);
      url.append(username);
      HttpGet get = new HttpGet(url.toString());
  
      HttpResponse r = client.execute(get);
      //httpStuff.setText("xxx");
      int status = r.getStatusLine().getStatusCode();
      if(status == 200) {
          HttpEntity e = r.getEntity();
          String data = EntityUtils.toString(e);
          JSONObject last = new JSONObject(data);
  
          return last;
      }
      else {
          Toast.makeText(Http.this, "error", Toast.LENGTH_SHORT);
          return null;
  
      }
  }
  
  public class Read extends AsyncTask &lt;String, Integer, String&gt; {
  
      @Override
      protected String doInBackground(String... arg0) {
          // TODO Auto-generated method stub
          try {
              json = lastSub("avm12");
              return json.getString(arg0[0]);
          } catch (ClientProtocolException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (JSONException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
          return null;
      }
  
      @Override
      protected void onPostExecute(String result) {
          // TODO Auto-generated method stub
          httpStuff.setText(result);
      }
  
  }
  </code></pre>
  
  <p>}</p>