title: Get string from jsonArray java android
body: <p>I am making an android app and have to use json. I am very new to JSON so I have a question. I have got the following json code from a HttpUrlConnection:</p>
  
  <pre><code> [{"id":"12","name":"John","surname":"Doe","age":"23","username":"123"}]
  </code></pre>
  
  <p>How can I convert this string to a jsonArray and get the "23" out of this array using java? I already searched a lot on stackoverflow but didn't got the right answer. Hope somebody could help me.</p>
  
  <p>I already tried to make it an jsonObject but it didn't work. Result is the string I've got from the HttpUrlConnection:</p>
  
  <pre><code>JSONObject jsonObject = new JSONObject(result);
  String jsonname = jsonObject.getString("age");
  </code></pre>