title: how to convert JSON string to object in JAVA android
body: <p>How do I to convert a JSON string to object in Java Android  so that I can access "name2"</p>
  
  <p>thanks</p>
  
  <pre><code>// this is how my json looks {"name1":"a","name2":"b","name3":"c","name4":"d"}
  
  String mytext = GetMyJSON();
  
  JSONObject obj = new JSONObject(mytext);
  
  Strin N1  = obj.name1;
  </code></pre>